1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #29727 -- Made nonexistent joins in F() raise FieldError.

Regression in 2162f0983d.
This commit is contained in:
Alexander Holmbäck
2018-09-06 20:10:20 +00:00
committed by Tim Graham
parent aa16ec5474
commit f315d0423a
3 changed files with 10 additions and 2 deletions

View File

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