MCPcopy
hub / github.com/django/django / test_overwrite_annotation_with_alias

Method test_overwrite_annotation_with_alias

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

Source from the content-addressed store, hash-verified

1394 self.assertIs(hasattr(book, "is_book_alias"), False)
1395
1396 def test_overwrite_annotation_with_alias(self):
1397 qs = Book.objects.annotate(is_book=Value(1)).alias(is_book=F("is_book"))
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"))

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected