MCPcopy
hub / github.com/django/django / test_fk_fetch_mode_raise

Method test_fk_fetch_mode_raise

tests/raw_query/tests.py:169–176  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

167 books[1].author
168
169 def test_fk_fetch_mode_raise(self):
170 query = "SELECT * FROM raw_query_book"
171 books = list(Book.objects.fetch_mode(RAISE).raw(query))
172 msg = "Fetching of Book.author blocked."
173 with self.assertRaisesMessage(FieldFetchBlocked, msg) as cm:
174 books[0].author
175 self.assertIsNone(cm.exception.__cause__)
176 self.assertTrue(cm.exception.__suppress_context__)
177
178 def test_db_column_handler(self):
179 """

Callers

nothing calls this directly

Calls 3

fetch_modeMethod · 0.80
assertRaisesMessageMethod · 0.80
rawMethod · 0.45

Tested by

no test coverage detected