Fix asserts for errors that come back with visualised location

This commit is contained in:
Tomasz Kontusz 2019-09-15 18:30:00 +02:00 committed by Jean-Louis Fuchs
parent 51fe6d06a9
commit b63fd1cd7c
No known key found for this signature in database
GPG Key ID: 3440F981335FD30F
2 changed files with 9 additions and 7 deletions

View File

@ -52,7 +52,9 @@ def get_choices(choices):
while name in converted_names:
name += "_" + str(len(converted_names))
converted_names.append(name)
description = str(help_text) # TODO: translatable description: https://github.com/graphql-python/graphql-core-next/issues/58
description = str(
help_text
) # TODO: translatable description: https://github.com/graphql-python/graphql-core-next/issues/58
yield name, value, description

View File

@ -612,9 +612,9 @@ def test_should_enforce_first_or_last(graphene_settings):
result = schema.execute(query)
assert len(result.errors) == 1
assert str(result.errors[0]) == (
assert str(result.errors[0]).startswith(
"You must provide a `first` or `last` value to properly "
"paginate the `allReporters` connection."
"paginate the `allReporters` connection.\n"
)
assert result.data == expected
@ -653,9 +653,9 @@ def test_should_error_if_first_is_greater_than_max(graphene_settings):
result = schema.execute(query)
assert len(result.errors) == 1
assert str(result.errors[0]) == (
assert str(result.errors[0]).startswith(
"Requesting 101 records on the `allReporters` connection "
"exceeds the `first` limit of 100 records."
"exceeds the `first` limit of 100 records.\n"
)
assert result.data == expected
@ -694,9 +694,9 @@ def test_should_error_if_last_is_greater_than_max(graphene_settings):
result = schema.execute(query)
assert len(result.errors) == 1
assert str(result.errors[0]) == (
assert str(result.errors[0]).startswith(
"Requesting 101 records on the `allReporters` connection "
"exceeds the `last` limit of 100 records."
"exceeds the `last` limit of 100 records.\n"
)
assert result.data == expected