MCPcopy
hub / github.com/django/django / test_transform

Method test_transform

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

Source from the content-addressed store, hash-verified

79 self.assertEqual(lookup.lhs.target, Item._meta.get_field("modified"))
80
81 def test_transform(self):
82 query = Query(Author, alias_cols=False)
83 with register_lookup(CharField, Lower):
84 where = query.build_where(~Q(name__lower="foo"))
85 lookup = where.children[0]
86 self.assertIsInstance(lookup, Exact)
87 self.assertIsInstance(lookup.lhs, Lower)
88 self.assertIsInstance(lookup.lhs.lhs, Col)
89 self.assertIsNone(lookup.lhs.lhs.alias)
90 self.assertEqual(lookup.lhs.lhs.target, Author._meta.get_field("name"))
91
92 def test_negated_nullable(self):
93 query = Query(Item)

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected