Skip to content

Commit d6fd3fc

Browse files
committed
Fix asserts for errors that come back with visualised location
1 parent c7dea56 commit d6fd3fc

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

graphene_django/filter/tests/test_fields.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -657,8 +657,8 @@ def resolve_all_reporters(self, info, **args):
657657

658658
result = schema.execute(query)
659659
assert len(result.errors) == 1
660-
assert str(result.errors[0]) == (
661-
"Received two sliced querysets (high mark) in the connection, please slice only in one."
660+
assert str(result.errors[0]).startswith(
661+
"Received two sliced querysets (high mark) in the connection, please slice only in one.\n"
662662
)
663663

664664

graphene_django/tests/test_query.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -620,9 +620,9 @@ class Query(graphene.ObjectType):
620620

621621
result = schema.execute(query)
622622
assert len(result.errors) == 1
623-
assert str(result.errors[0]) == (
623+
assert str(result.errors[0]).startswith(
624624
"You must provide a `first` or `last` value to properly "
625-
"paginate the `allReporters` connection."
625+
"paginate the `allReporters` connection.\n"
626626
)
627627
assert result.data == expected
628628

@@ -659,9 +659,9 @@ class Query(graphene.ObjectType):
659659

660660
result = schema.execute(query)
661661
assert len(result.errors) == 1
662-
assert str(result.errors[0]) == (
662+
assert str(result.errors[0]).startswith(
663663
"Requesting 101 records on the `allReporters` connection "
664-
"exceeds the `first` limit of 100 records."
664+
"exceeds the `first` limit of 100 records.\n"
665665
)
666666
assert result.data == expected
667667

@@ -700,9 +700,9 @@ class Query(graphene.ObjectType):
700700

701701
result = schema.execute(query)
702702
assert len(result.errors) == 1
703-
assert str(result.errors[0]) == (
703+
assert str(result.errors[0]).startswith(
704704
"Requesting 101 records on the `allReporters` connection "
705-
"exceeds the `last` limit of 100 records."
705+
"exceeds the `last` limit of 100 records.\n"
706706
)
707707
assert result.data == expected
708708

0 commit comments

Comments
 (0)