MCPcopy
hub / github.com/django/django / test_multiple_fields

Method test_multiple_fields

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

Source from the content-addressed store, hash-verified

67 self.assertEqual(lookup.lhs.target, Author._meta.get_field("num"))
68
69 def test_multiple_fields(self):
70 query = Query(Item, alias_cols=False)
71 where = query.build_where(Q(modified__gt=F("created")))
72 lookup = where.children[0]
73 self.assertIsInstance(lookup, GreaterThan)
74 self.assertIsInstance(lookup.rhs, Col)
75 self.assertIsNone(lookup.rhs.alias)
76 self.assertIsInstance(lookup.lhs, Col)
77 self.assertIsNone(lookup.lhs.alias)
78 self.assertEqual(lookup.rhs.target, Item._meta.get_field("created"))
79 self.assertEqual(lookup.lhs.target, Item._meta.get_field("modified"))
80
81 def test_transform(self):
82 query = Query(Author, alias_cols=False)

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected