summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlexander Holmbäck <alexande.holmback@creuna.se>2018-09-06 20:10:20 +0000
committerTim Graham <timograham@gmail.com>2018-09-08 09:50:02 -0400
commitbd5ce0599bf0dc156b943ca0d03307c7e451923c (patch)
tree09ac5baa362b6ba77ddb5962fb179156824aa7f8 /tests
parented60ce55c2dd8a3940fa5ae9f1622f101c8421ad (diff)
[2.1.x] Fixed #29727 -- Made nonexistent joins in F() raise FieldError.
Regression in 2162f0983de0dfe2178531638ce7ea56f54dd4e7. Backport of f315d0423a09dfe20dd4d4f6a0eb11fc8e45a665 from master
Diffstat (limited to 'tests')
-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 973176e223..9a646088b1 100644
--- a/tests/expressions/tests.py
+++ b/tests/expressions/tests.py
@@ -595,6 +595,10 @@ class BasicExpressionsTests(TestCase):
with self.assertRaisesMessage(FieldError, "Cannot resolve keyword 'nope' into field."):
list(Employee.objects.filter(firstname=F('nope')))
+ def test_incorrect_joined_field_in_F_expression(self):
+ with self.assertRaisesMessage(FieldError, "Cannot resolve keyword 'nope' into field."):
+ list(Company.objects.filter(ceo__pk=F('point_of_contact__nope')))
+
class IterableLookupInnerExpressionsTests(TestCase):
@classmethod