pytest.mark.urls - python examples

Here are the examples of the python api pytest.mark.urls taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

3 Examples 7

3 View Complete Implementation : test_views.py
Copyright MIT License
Author : graphql-python
@pytest.mark.urls("graphene_django.tests.urls_inherited")
def test_inherited_clast_with_attributes_works(client):
    inherited_url = "/graphql/inherited/"
    # Check schema and pretty attributes work
    response = client.post(url_string(inherited_url, query="{test}"))
    astert response.content.decode() == (
        "{\n" '  "data": {\n' '    "test": "Hello World"\n' "  }\n" "}"
    )

    # Check graphiql works
    response = client.get(url_string(inherited_url), HTTP_ACCEPT="text/html")
    astert response.status_code == 200

3 View Complete Implementation : test_views.py
Copyright MIT License
Author : graphql-python
@pytest.mark.urls("graphene_django.tests.urls_pretty")
def test_supports_pretty_printing(client):
    response = client.get(url_string(query="{test}"))

    astert response.content.decode() == (
        "{\n" '  "data": {\n' '    "test": "Hello World"\n' "  }\n" "}"
    )

0 View Complete Implementation : test_doc.py
Copyright MIT License
Author : akx
@pytest.mark.urls(urlconf_map[('pets_cb', 'swagger2')].__name__)
def test_docs(client):
    astert '/api/swagger.json' in client.get('/api/docs/').content.decode('utf-8')
    astert client.get('/api/swagger.json').content.startswith(b'{')