MCPcopy
hub / github.com/django/django / test_overwrite_alias_with_annotation

Method test_overwrite_alias_with_annotation

tests/annotations/tests.py:1400–1404  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1398 self.assertIs(hasattr(qs.first(), "is_book"), False)
1399
1400 def test_overwrite_alias_with_annotation(self):
1401 qs = Book.objects.alias(is_book=Value(1)).annotate(is_book=F("is_book"))
1402 for book in qs:
1403 with self.subTest(book=book):
1404 self.assertEqual(book.is_book, 1)
1405
1406 def test_alias_annotation_expression(self):
1407 qs = Book.objects.alias(

Callers

nothing calls this directly

Calls 4

ValueClass · 0.90
FClass · 0.90
annotateMethod · 0.80
aliasMethod · 0.80

Tested by

no test coverage detected