Fixed typo in assertQuerysetEqual() exception message.

This commit is contained in:
Jacob Walls 2021-02-26 07:26:48 -05:00 committed by Mariusz Felisiak
parent 7587139d35
commit 64a0d1ef6e
2 changed files with 8 additions and 3 deletions

View File

@ -1066,8 +1066,10 @@ class TransactionTestCase(SimpleTestCase):
# For example qs.iterator() could be passed as qs, but it does not
# have 'ordered' attribute.
if len(values) > 1 and hasattr(qs, 'ordered') and not qs.ordered:
raise ValueError("Trying to compare non-ordered queryset "
"against more than one ordered values")
raise ValueError(
'Trying to compare non-ordered queryset against more than one '
'ordered value.'
)
return self.assertEqual(list(items), values, msg=msg)
def assertNumQueries(self, num, func=None, *args, using=DEFAULT_DB_ALIAS, **kwargs):

View File

@ -289,7 +289,10 @@ class AssertQuerysetEqualTests(TestCase):
def test_undefined_order(self):
# Using an unordered queryset with more than one ordered value
# is an error.
msg = 'Trying to compare non-ordered queryset against more than one ordered values'
msg = (
'Trying to compare non-ordered queryset against more than one '
'ordered value.'
)
with self.assertRaisesMessage(ValueError, msg):
self.assertQuerysetEqual(
Person.objects.all(),