Fix GraphQLView tests, skip some of them

Some of the tests show the problem described here: https://github.com/graphql-python/graphql-core-next/issues/61
This commit is contained in:
Tomasz Kontusz 2019-09-15 22:11:09 +02:00 committed by Jean-Louis Fuchs
parent 10269267a4
commit 758f326375
No known key found for this signature in database
GPG Key ID: 3440F981335FD30F

View File

@ -92,6 +92,9 @@ def test_allows_get_with_operation_name(client):
}
@pytest.mark.xfail(
reason="SourceLocation serialization problem: https://github.com/graphql-python/graphql-core-next/issues/61"
)
def test_reports_validation_errors(client):
response = client.get(url_string(query="{ test, unknownOne, unknownTwo }"))
@ -99,12 +102,14 @@ def test_reports_validation_errors(client):
assert response_json(response) == {
"errors": [
{
"message": 'Cannot query field "unknownOne" on type "QueryRoot".',
"message": "Cannot query field 'unknownOne' on type 'QueryRoot'.",
"locations": [{"line": 1, "column": 9}],
"path": None,
},
{
"message": 'Cannot query field "unknownTwo" on type "QueryRoot".',
"message": "Cannot query field 'unknownTwo' on type 'QueryRoot'.",
"locations": [{"line": 1, "column": 21}],
"path": None,
},
]
}
@ -124,7 +129,9 @@ def test_errors_when_missing_operation_name(client):
assert response_json(response) == {
"errors": [
{
"message": "Must provide operation name if query contains multiple operations."
"locations": None,
"message": "Must provide operation name if query contains multiple operations.",
"path": None,
}
]
}
@ -442,6 +449,9 @@ def test_supports_pretty_printing_by_request(client):
)
@pytest.mark.xfail(
reason="SourceLocation serialization problem: https://github.com/graphql-python/graphql-core-next/issues/61"
)
def test_handles_field_errors_caught_by_graphql(client):
response = client.get(url_string(query="{thrower}"))
assert response.status_code == 200
@ -457,6 +467,9 @@ def test_handles_field_errors_caught_by_graphql(client):
}
@pytest.mark.xfail(
reason="SourceLocation serialization problem: https://github.com/graphql-python/graphql-core-next/issues/61"
)
def test_handles_syntax_errors_caught_by_graphql(client):
response = client.get(url_string(query="syntaxerror"))
assert response.status_code == 400