MCPcopy
hub / github.com/django/django / test_simple_query

Method test_simple_query

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

Source from the content-addressed store, hash-verified

25
26class TestQuery(SimpleTestCase):
27 def test_simple_query(self):
28 query = Query(Author)
29 where = query.build_where(Q(num__gt=2))
30 lookup = where.children[0]
31 self.assertIsInstance(lookup, GreaterThan)
32 self.assertEqual(lookup.rhs, 2)
33 self.assertEqual(lookup.lhs.target, Author._meta.get_field("num"))
34
35 def test_non_alias_cols_query(self):
36 query = Query(Author, alias_cols=False)

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