(self)
| 329 | self.assertTrue(cm.exception.__suppress_context__) |
| 330 | |
| 331 | def test_annotations(self): |
| 332 | query = ( |
| 333 | "SELECT a.*, count(b.id) as book_count " |
| 334 | "FROM raw_query_author a " |
| 335 | "LEFT JOIN raw_query_book b ON a.id = b.author_id " |
| 336 | "GROUP BY a.id, a.first_name, a.last_name, a.dob ORDER BY a.id" |
| 337 | ) |
| 338 | expected_annotations = ( |
| 339 | ("book_count", 3), |
| 340 | ("book_count", 0), |
| 341 | ("book_count", 1), |
| 342 | ("book_count", 0), |
| 343 | ) |
| 344 | authors = Author.objects.order_by("pk") |
| 345 | self.assertSuccessfulRawQuery(Author, query, authors, expected_annotations) |
| 346 | |
| 347 | def test_white_space_query(self): |
| 348 | query = " SELECT * FROM raw_query_author" |
nothing calls this directly
no test coverage detected