1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #25544 -- Removed duplicate ids in prefetch_related() queries.

This commit is contained in:
Ian Foote
2015-11-07 16:06:06 +01:00
committed by Tim Graham
parent ed1bcf0515
commit 86eccdc8b6
4 changed files with 48 additions and 4 deletions

View File

@@ -67,6 +67,14 @@ class TestQuerying(PostgreSQLTestCase):
self.objs[:2]
)
def test_in_generator(self):
def search():
yield {'a': 'b'}
self.assertSequenceEqual(
HStoreModel.objects.filter(field__in=search()),
self.objs[:1]
)
def test_has_key(self):
self.assertSequenceEqual(
HStoreModel.objects.filter(field__has_key='c'),