MCPcopy
hub / github.com/django/django / test_negated_nullable

Method test_negated_nullable

tests/queries/test_query.py:92–101  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

90 self.assertEqual(lookup.lhs.lhs.target, Author._meta.get_field("name"))
91
92 def test_negated_nullable(self):
93 query = Query(Item)
94 where = query.build_where(~Q(modified__lt=datetime(2017, 1, 1)))
95 self.assertTrue(where.negated)
96 lookup = where.children[0]
97 self.assertIsInstance(lookup, LessThan)
98 self.assertEqual(lookup.lhs.target, Item._meta.get_field("modified"))
99 lookup = where.children[1]
100 self.assertIsInstance(lookup, IsNull)
101 self.assertEqual(lookup.lhs.target, Item._meta.get_field("modified"))
102
103 def test_foreign_key(self):
104 query = Query(Item)

Callers

nothing calls this directly

Calls 4

build_whereMethod · 0.95
QueryClass · 0.90
QClass · 0.90
get_fieldMethod · 0.45

Tested by

no test coverage detected