summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2019-04-19 11:40:04 +0200
committerGitHub <noreply@github.com>2019-04-19 11:40:04 +0200
commit12b7956fc3735101fcad597047b80b57efb5048a (patch)
tree117964dd33f7bf0b9d437f8ffc73b7427bc0050a
parent49fb3f5f3ed8b37f2ae02d0fdc6980c4152c58e3 (diff)
Refs #25507 -- Added tests for using QuerySet.count() with a RawSQL annotation.
Fixed in 3f32154f40a855afa063095e3d091ce6be21f2c5
-rw-r--r--tests/expressions/tests.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/expressions/tests.py b/tests/expressions/tests.py
index c20b88ff83..c22ff34ee8 100644
--- a/tests/expressions/tests.py
+++ b/tests/expressions/tests.py
@@ -70,6 +70,10 @@ class BasicExpressionsTests(TestCase):
['<Company: Example Inc.>', '<Company: Foobar Ltd.>', '<Company: Test GmbH>'],
)
+ def test_annotate_values_count(self):
+ companies = Company.objects.annotate(foo=RawSQL('%s', ['value']))
+ self.assertEqual(companies.count(), 3)
+
@unittest.skipIf(connection.vendor == 'oracle', "Oracle doesn't support using boolean type in SELECT")
def test_filtering_on_annotate_that_uses_q(self):
self.assertEqual(