MCPcopy
hub / github.com/django/django / test_composite_pk_in_fields

Method test_composite_pk_in_fields

tests/composite_pk/tests.py:110–115  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

108 user.pk = pk
109
110 def test_composite_pk_in_fields(self):
111 user_fields = {f.name for f in User._meta.get_fields()}
112 self.assertTrue({"pk", "tenant", "id"}.issubset(user_fields))
113
114 comment_fields = {f.name for f in Comment._meta.get_fields()}
115 self.assertTrue({"pk", "tenant", "id"}.issubset(comment_fields))
116
117 def test_pk_field(self):
118 pk = User._meta.get_field("pk")

Callers

nothing calls this directly

Calls 1

get_fieldsMethod · 0.45

Tested by

no test coverage detected