mirror of
https://github.com/django/django.git
synced 2025-10-25 14:46:09 +00:00
[2.1.x] Fixed #29727 -- Made nonexistent joins in F() raise FieldError.
Regression in2162f0983d. Backport off315d0423afrom master
This commit is contained in:
committed by
Tim Graham
parent
ed60ce55c2
commit
bd5ce0599b
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user