MCPcopy
hub / github.com/django/django / test_relation_on_abstract

Method test_relation_on_abstract

tests/admin_utils/tests.py:107–115  ·  view source on GitHub ↗

NestedObjects.collect() doesn't trip (AttributeError) on the special notation for relations on abstract models (related_name that contains %(app_label)s and/or %(class)s) (#21846).

(self)

Source from the content-addressed store, hash-verified

105 n.collect(objs)
106
107 def test_relation_on_abstract(self):
108 """
109 NestedObjects.collect() doesn't trip (AttributeError) on the special
110 notation for relations on abstract models (related_name that contains
111 %(app_label)s and/or %(class)s) (#21846).
112 """
113 n = NestedObjects(using=DEFAULT_DB_ALIAS)
114 Car.objects.create()
115 n.collect([Vehicle.objects.first()])
116
117
118@skipUnlessDBFeature("supports_on_delete_db_cascade")

Callers

nothing calls this directly

Calls 4

collectMethod · 0.95
NestedObjectsClass · 0.90
firstMethod · 0.80
createMethod · 0.45

Tested by

no test coverage detected