MCPcopy
hub / github.com/django/django / test_related_objects

Method test_related_objects

tests/model_meta/tests.py:114–125  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

112 return r[0]
113
114 def test_related_objects(self):
115 result_key = "get_all_related_objects_with_model"
116 for model, expected in TEST_RESULTS[result_key].items():
117 objects = [
118 (field, self._model(model, field))
119 for field in model._meta.get_fields()
120 if field.auto_created and not field.concrete
121 ]
122 self.assertEqual(
123 sorted(self._map_related_query_names(objects), key=self.key_name),
124 sorted(expected, key=self.key_name),
125 )
126
127 def test_related_objects_local(self):
128 result_key = "get_all_related_objects_with_model_local"

Callers

nothing calls this directly

Calls 4

_modelMethod · 0.80
itemsMethod · 0.45
get_fieldsMethod · 0.45

Tested by

no test coverage detected