mirror of
https://github.com/django/django.git
synced 2025-08-03 02:23:12 +00:00
Fixed #25609 -- Fixed regression in related field nested lookup error.
This commit is contained in:
parent
976bd519a8
commit
32ef48aa56
2 changed files with 10 additions and 1 deletions
|
@ -493,6 +493,12 @@ class LookupTests(TestCase):
|
|||
str(ex), "Unsupported lookup 'starts' for CharField "
|
||||
"or join on the field not permitted.")
|
||||
|
||||
def test_relation_nested_lookup_error(self):
|
||||
# An invalid nested lookup on a related field raises a useful error.
|
||||
msg = 'Related Field got invalid lookup: editor'
|
||||
with self.assertRaisesMessage(FieldError, msg):
|
||||
Article.objects.filter(author__editor__name='James')
|
||||
|
||||
def test_regex(self):
|
||||
# Create some articles with a bit more interesting headlines for testing field lookups:
|
||||
for a in Article.objects.all():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue