MCPcopy
hub / github.com/django/django / test_ticket10432

Method test_ticket10432

tests/queries/tests.py:958–969  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

956 self.assertEqual(Tag.objects.filter(name__in=()).update(name="foo"), 0)
957
958 def test_ticket10432(self):
959 # Testing an empty "__in" filter with a generator as the value.
960 def f():
961 return iter([])
962
963 n_obj = Note.objects.all()[0]
964
965 def g():
966 yield n_obj.pk
967
968 self.assertSequenceEqual(Note.objects.filter(pk__in=f()), [])
969 self.assertEqual(list(Note.objects.filter(pk__in=g())), [n_obj])
970
971 def test_ticket10742(self):
972 # Queries used in an __in clause don't execute subqueries

Callers

nothing calls this directly

Calls 3

fFunction · 0.85
allMethod · 0.45
filterMethod · 0.45

Tested by

no test coverage detected