MCPcopy
hub / github.com/django/django / test_select_related_only

Method test_select_related_only

tests/proxy_models/tests.py:404–408  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

402 self.assertEqual(p.name, "Elvis Presley")
403
404 def test_select_related_only(self):
405 user = ProxyTrackerUser.objects.create(name="Joe Doe", status="test")
406 issue = Issue.objects.create(summary="New issue", assignee=user)
407 qs = Issue.objects.select_related("assignee").only("assignee__status")
408 self.assertEqual(qs.get(), issue)
409
410 def test_eq(self):
411 self.assertEqual(MyPerson(id=100), Person(id=100))

Callers

nothing calls this directly

Calls 4

onlyMethod · 0.80
select_relatedMethod · 0.80
createMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected