We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent df4468b commit 9891326Copy full SHA for 9891326
tests/model_fields_/test_embedded_model.py
@@ -104,6 +104,11 @@ def test_nested(self):
104
)
105
self.assertCountEqual(Book.objects.filter(author__address__city="NYC"), [obj])
106
107
+ def test_field_not_exists(self):
108
+ msg = "Author has no field named 'first_name'"
109
+ with self.assertRaisesMessage(FieldDoesNotExist, msg):
110
+ Book.objects.filter(author__first_name="Bob")
111
+
112
def test_nested_not_exists(self):
113
msg = "Unsupported lookup 'president' for CharField 'city'"
114
with self.assertRaisesMessage(FieldDoesNotExist, msg):
0 commit comments