summaryrefslogtreecommitdiff
path: root/tests/queries
diff options
context:
space:
mode:
authorAnssi Kääriäinen <anssi.kaariainen@thl.fi>2015-02-02 13:48:30 +0200
committerTim Graham <timograham@gmail.com>2015-03-25 08:05:22 -0400
commitb68212f539f206679580afbfd008e7d329c9cd31 (patch)
treeccd9dd3b734617afd95b8de48fc9acb3823cc14d /tests/queries
parent8654c6a7329c06133b6c4b32f05e606132a338e5 (diff)
downloaddjango-b68212f539f206679580afbfd008e7d329c9cd31.tar.gz
Refs #24267 -- Implemented lookups for related fields
Previously related fields didn't implement get_lookup, instead related fields were treated specially. This commit removed some of the special handling. In particular, related fields return Lookup instances now, too. Other notable changes in this commit is removal of support for annotations in names_to_path().
Diffstat (limited to 'tests/queries')
-rw-r--r--tests/queries/tests.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/queries/tests.py b/tests/queries/tests.py
index 9c521c1c03..82d6d1fe7c 100644
--- a/tests/queries/tests.py
+++ b/tests/queries/tests.py
@@ -3678,3 +3678,11 @@ class TestTicket24279(TestCase):
School.objects.create()
qs = School.objects.filter(Q(pk__in=()) | Q())
self.assertQuerysetEqual(qs, [])
+
+
+class TestInvalidValuesRelation(TestCase):
+ def test_invalid_values(self):
+ with self.assertRaises(ValueError):
+ Annotation.objects.filter(tag='abc')
+ with self.assertRaises(ValueError):
+ Annotation.objects.filter(tag__in=[123, 'abc'])