MCPcopy
hub / github.com/django/django / assert_delayed

Method assert_delayed

tests/defer/tests.py:20–27  ·  view source on GitHub ↗

Instances with deferred fields look the same as normal instances when we examine attribute values. Therefore, this method returns the number of deferred fields on returned instances.

(self, obj, num)

Source from the content-addressed store, hash-verified

18
19class AssertionMixin:
20 def assert_delayed(self, obj, num):
21 """
22 Instances with deferred fields look the same as normal instances when
23 we examine attribute values. Therefore, this method returns the number
24 of deferred fields on returned instances.
25 """
26 count = len(obj.get_deferred_fields())
27 self.assertEqual(count, num)
28
29
30class DeferTests(AssertionMixin, TestCase):

Calls 1

get_deferred_fieldsMethod · 0.80

Tested by

no test coverage detected