diff --git a/tests/generic_relations/tests.py b/tests/generic_relations/tests.py index ae90ace34a9..3e05bb72259 100644 --- a/tests/generic_relations/tests.py +++ b/tests/generic_relations/tests.py @@ -304,6 +304,10 @@ class GenericRelationsTests(TestCase): self.assertFalse(created) self.assertEqual(tag.content_object.id, diamond.id) + def test_query_content_type(self): + with six.assertRaisesRegex(self, FieldError, "^Cannot resolve keyword 'content_object' into field."): + TaggedItem.objects.get(content_object='') + class CustomWidget(forms.TextInput): pass