MCPcopy
hub / github.com/django/django / test_get

Method test_get

tests/defer/tests.py:127–131  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

125 )
126
127 def test_get(self):
128 # Using defer() and only() with get() is also valid.
129 qs = Primary.objects.all()
130 self.assert_delayed(qs.defer("name").get(pk=self.p1.pk), 1)
131 self.assert_delayed(qs.only("name").get(pk=self.p1.pk), 2)
132
133 def test_defer_with_select_related(self):
134 obj = Primary.objects.select_related("related").defer(

Callers

nothing calls this directly

Calls 5

assert_delayedMethod · 0.80
deferMethod · 0.80
onlyMethod · 0.80
allMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected