diff options
| author | Ian Foote <python@ian.feete.org> | 2015-10-25 23:29:34 +0000 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-10-27 13:57:52 -0400 |
| commit | 32e804cdb7e09c260fa1f224962831d2b672af85 (patch) | |
| tree | 77dcfca870d443ce86550d37786fa7dfcbeb9611 /tests | |
| parent | da9e9484f2407ea5f2309ba1899fc93c58d206e3 (diff) | |
[1.9.x] Fixed #25609 -- Fixed regression in related field nested lookup error.
Backport of 32ef48aa562e6aaee9983f5d0f1c60f02fd555fb from master
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/lookup/tests.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/lookup/tests.py b/tests/lookup/tests.py index 49c6f7101e..0954d24f34 100644 --- a/tests/lookup/tests.py +++ b/tests/lookup/tests.py @@ -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(): |
