MCPcopy
hub / github.com/django/django / test_annotate_with_dates

Method test_annotate_with_dates

tests/aggregation_regress/tests.py:1091–1104  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1089 )
1090
1091 def test_annotate_with_dates(self):
1092 # Regression for #10248 - Annotations work with dates()
1093 qs = (
1094 Book.objects.annotate(num_authors=Count("authors"))
1095 .filter(num_authors=2)
1096 .dates("pubdate", "day")
1097 )
1098 self.assertSequenceEqual(
1099 qs,
1100 [
1101 datetime.date(1995, 1, 15),
1102 datetime.date(2007, 12, 6),
1103 ],
1104 )
1105
1106 def test_extra_select_grouping_with_params(self):
1107 # Regression for #10290 - extra selects with parameters can be used for

Callers

nothing calls this directly

Calls 4

CountClass · 0.90
datesMethod · 0.80
annotateMethod · 0.80
filterMethod · 0.45

Tested by

no test coverage detected