mirror of
https://github.com/django/django.git
synced 2025-11-25 05:04:26 +00:00
Fixed #23697 -- Improved ForeignObject.get_lookup_constraint() error message.
This commit is contained in:
parent
a4a58811b9
commit
00e667728b
2 changed files with 15 additions and 1 deletions
|
|
@ -1164,6 +1164,15 @@ class Queries1Tests(BaseQuerysetTest):
|
|||
['<Author: a1>', '<Author: a2>', '<Author: a3>', '<Author: a4>']
|
||||
)
|
||||
|
||||
def test_lookup_constraint_fielderror(self):
|
||||
msg = (
|
||||
"Cannot resolve keyword 'unknown_field' into field. Choices are: "
|
||||
"annotation, category, category_id, children, id, item, "
|
||||
"managedmodel, name, parent, parent_id"
|
||||
)
|
||||
with self.assertRaisesMessage(FieldError, msg):
|
||||
Tag.objects.filter(unknown_field__name='generic')
|
||||
|
||||
|
||||
class Queries2Tests(TestCase):
|
||||
@classmethod
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue