1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00

Refs #25507 -- Added tests for using QuerySet.count() with a RawSQL annotation.

Fixed in 3f32154f40
This commit is contained in:
Mariusz Felisiak 2019-04-19 11:40:04 +02:00 committed by GitHub
parent 49fb3f5f3e
commit 12b7956fc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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(