MCPcopy
hub / github.com/django/django / test_foreign_key

Method test_foreign_key

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

Source from the content-addressed store, hash-verified

101 self.assertEqual(lookup.lhs.target, Item._meta.get_field("modified"))
102
103 def test_foreign_key(self):
104 query = Query(Item)
105 msg = "Joined field references are not permitted in this query"
106 with self.assertRaisesMessage(FieldError, msg):
107 query.build_where(Q(creator__num__gt=2))
108
109 def test_foreign_key_f(self):
110 query = Query(Ranking)

Callers

nothing calls this directly

Calls 4

build_whereMethod · 0.95
QueryClass · 0.90
QClass · 0.90
assertRaisesMessageMethod · 0.80

Tested by

no test coverage detected