(self)
| 319 | authors[1].last_name |
| 320 | |
| 321 | def test_missing_fields_fetch_mode_raise(self): |
| 322 | query = "SELECT id, first_name, dob FROM raw_query_author" |
| 323 | authors = list(Author.objects.fetch_mode(RAISE).raw(query)) |
| 324 | msg = "Fetching of Author.last_name blocked." |
| 325 | with self.assertRaisesMessage(FieldFetchBlocked, msg) as cm: |
| 326 | authors[0].last_name |
| 327 | self.assertIsNone(cm.exception.__cause__) |
| 328 | self.assertTrue(cm.exception.__suppress_context__) |
| 329 | self.assertTrue(cm.exception.__suppress_context__) |
| 330 | |
| 331 | def test_annotations(self): |
| 332 | query = ( |
nothing calls this directly
no test coverage detected