diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 432a9ac29..220a581af 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -27,6 +27,7 @@ Fixed - Fix `get_annotations` now evaluates annotations in the default scope instead of the app namespace. (#1552) - Fix `get_or_create` method. (#1404) - Use `index_name` instead of `BaseSchemaGenerator._generate_index_name` to generate index name. +- Use subquery for count() and exists() in `QuerySet` to match count result to `QuerySet` result. (#1607) Changed ^^^^^^^ diff --git a/tests/test_queryset.py b/tests/test_queryset.py index a71e5c7ff..d7d49faf8 100644 --- a/tests/test_queryset.py +++ b/tests/test_queryset.py @@ -476,7 +476,7 @@ async def test_annotate_order_expression(self): self.assertEqual(data[0] + 1, data[1]) async def test_annotate_expression_filter(self): - count = await IntFields.annotate(intnum=F("intnum") + 1).filter(intnum__gt=30).count() + count = await IntFields.annotate(intnum1=F("intnum") + 1).filter(intnum1__gt=30).count() self.assertEqual(count, 23) async def test_get_raw_sql(self):