MCPcopy
hub / github.com/django/django / test_fetch_mode_raise

Method test_fetch_mode_raise

tests/generic_relations/tests.py:815–821  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

813 self.assertEqual(quartz_tag.content_object, self.quartz)
814
815 def test_fetch_mode_raise(self):
816 tag = TaggedItem.objects.fetch_mode(RAISE).get(tag="yellow")
817 msg = "Fetching of TaggedItem.content_object blocked."
818 with self.assertRaisesMessage(FieldFetchBlocked, msg) as cm:
819 tag.content_object
820 self.assertIsNone(cm.exception.__cause__)
821 self.assertTrue(cm.exception.__suppress_context__)
822
823 def test_fetch_mode_copied_forward_fetching_one(self):
824 tag = TaggedItem.objects.fetch_mode(FETCH_PEERS).get(tag="yellow")

Callers

nothing calls this directly

Calls 3

fetch_modeMethod · 0.80
assertRaisesMessageMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected