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

Fixed #35413 -- Made unsupported lookup error message more specific.

This commit is contained in:
wookkl
2024-07-07 16:17:58 +09:00
committed by Sarah Boyce
parent 2c931fda5b
commit 759abc4daf
3 changed files with 45 additions and 4 deletions

View File

@@ -614,6 +614,10 @@ class LookupTransformCallOrderTests(SimpleTestCase):
)
TrackCallsYearTransform.call_order = []
# junk transform - tries transform only, then fails
msg = (
"Unsupported lookup 'junk__more_junk' for IntegerField or join"
" on the field not permitted."
)
with self.assertRaisesMessage(FieldError, msg):
Author.objects.filter(birthdate__testyear__junk__more_junk=2012)
self.assertEqual(TrackCallsYearTransform.call_order, ["transform"])