MCPcopy
hub / github.com/django/django / test_equal

Method test_equal

tests/queries/test_q.py:212–229  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

210 self.assertEqual(Q(*args, **kwargs), q)
211
212 def test_equal(self):
213 self.assertEqual(Q(), Q())
214 self.assertEqual(
215 Q(("pk__in", (1, 2))),
216 Q(("pk__in", [1, 2])),
217 )
218 self.assertEqual(
219 Q(("pk__in", (1, 2))),
220 Q(pk__in=[1, 2]),
221 )
222 self.assertEqual(
223 Q(("pk__in", (1, 2))),
224 Q(("pk__in", {1: "first", 2: "second"}.keys())),
225 )
226 self.assertNotEqual(
227 Q(name__iexact=F("other_name")),
228 Q(name=Lower(F("other_name"))),
229 )
230
231 def test_hash(self):
232 self.assertEqual(hash(Q()), hash(Q()))

Callers

nothing calls this directly

Calls 4

QClass · 0.90
FClass · 0.90
LowerClass · 0.90
keysMethod · 0.45

Tested by

no test coverage detected