mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #25508 -- Modified QuerySet.__repr__() to disambiguate it from a list.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user