MCPcopy
hub / github.com/django/django / test_unsupported_lookups_custom_lookups

Method test_unsupported_lookups_custom_lookups

tests/lookup/tests.py:1197–1205  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1195 Article.objects.filter(pub_date__gt__lt__foo="blahblah")
1196
1197 def test_unsupported_lookups_custom_lookups(self):
1198 slug_field = Article._meta.get_field("slug")
1199 msg = (
1200 "Unsupported lookup 'lengtp' for SlugField or join on the field not "
1201 "permitted, perhaps you meant length?"
1202 )
1203 with self.assertRaisesMessage(FieldError, msg):
1204 with register_lookup(slug_field, Length):
1205 Article.objects.filter(slug__lengtp=20)
1206
1207 def test_relation_nested_lookup_error(self):
1208 # An invalid nested lookup on a related field raises a useful error.

Callers

nothing calls this directly

Calls 4

register_lookupFunction · 0.90
assertRaisesMessageMethod · 0.80
get_fieldMethod · 0.45
filterMethod · 0.45

Tested by

no test coverage detected