(self)
| 1359 | self.assertIs(hasattr(qs.first(), "is_book"), False) |
| 1360 | |
| 1361 | def test_basic_alias_annotation(self): |
| 1362 | qs = Book.objects.alias( |
| 1363 | is_book_alias=Value(1), |
| 1364 | ).annotate(is_book=F("is_book_alias")) |
| 1365 | self.assertIs(hasattr(qs.first(), "is_book_alias"), False) |
| 1366 | for book in qs: |
| 1367 | with self.subTest(book=book): |
| 1368 | self.assertEqual(book.is_book, 1) |
| 1369 | |
| 1370 | def test_basic_alias_f_annotation(self): |
| 1371 | qs = Book.objects.alias(another_rating_alias=F("rating")).annotate( |