summaryrefslogtreecommitdiff
path: root/tests/string_lookup
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-10-05 19:07:34 -0400
committerTim Graham <timograham@gmail.com>2015-10-06 12:38:34 -0400
commite0837f2cb12de5e95e621d19b186b0da43bcdee2 (patch)
treeea6ae0b150304ed18d93fb8c3ee3b7defbda0e26 /tests/string_lookup
parent3543fec3b739864c52de0a116dde3b0e5e885799 (diff)
downloaddjango-e0837f2cb12de5e95e621d19b186b0da43bcdee2.tar.gz
Fixed #25508 -- Modified QuerySet.__repr__() to disambiguate it from a list.
Diffstat (limited to 'tests/string_lookup')
-rw-r--r--tests/string_lookup/tests.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/string_lookup/tests.py b/tests/string_lookup/tests.py
index 13a4544604..5f9d519bf5 100644
--- a/tests/string_lookup/tests.py
+++ b/tests/string_lookup/tests.py
@@ -78,7 +78,9 @@ class StringLookupTests(TestCase):
"""
a = Article(name='IP test', text='The body', submitted_from='192.0.2.100')
a.save()
- self.assertEqual(repr(Article.objects.filter(submitted_from__contains='192.0.2')),
- repr([a]))
+ self.assertQuerysetEqual(
+ Article.objects.filter(submitted_from__contains='192.0.2'),
+ [a], lambda x: x
+ )
# Test that the searches do not match the subnet mask (/32 in this case)
self.assertEqual(Article.objects.filter(submitted_from__contains='32').count(), 0)