summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2021-01-07 07:55:06 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-01-14 17:50:04 +0100
commit5e33ec80d153416d3693e89138ed21decf042672 (patch)
tree57d5feea09185981f50bbb27fd503b03ebc41106 /tests
parentd134b0b93ee10a2128c595997cbc6022c4a982f7 (diff)
Refs #30158 -- Made alias argument required in signature of Expression.get_group_by_cols() subclasses.
Per deprecation timeline.
Diffstat (limited to 'tests')
-rw-r--r--tests/expressions/test_deprecation.py24
1 files changed, 0 insertions, 24 deletions
diff --git a/tests/expressions/test_deprecation.py b/tests/expressions/test_deprecation.py
deleted file mode 100644
index cdb1e43af6..0000000000
--- a/tests/expressions/test_deprecation.py
+++ /dev/null
@@ -1,24 +0,0 @@
-from django.db.models import Count, Func
-from django.test import SimpleTestCase
-from django.utils.deprecation import RemovedInDjango40Warning
-
-from .models import Employee
-
-
-class MissingAliasFunc(Func):
- template = '1'
-
- def get_group_by_cols(self):
- return []
-
-
-class GetGroupByColsTest(SimpleTestCase):
- def test_missing_alias(self):
- msg = (
- '`alias=None` must be added to the signature of '
- 'expressions.test_deprecation.MissingAliasFunc.get_group_by_cols().'
- )
- with self.assertRaisesMessage(RemovedInDjango40Warning, msg):
- Employee.objects.values(
- one=MissingAliasFunc(),
- ).annotate(cnt=Count('company_ceo_set'))