MCPcopy
hub / github.com/django/django / test_transform

Method test_transform

tests/db_functions/text/test_ord.py:25–33  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

23 )
24
25 def test_transform(self):
26 with register_lookup(CharField, Ord):
27 authors = Author.objects.annotate(first_initial=Left("name", 1))
28 self.assertCountEqual(
29 authors.filter(first_initial__ord=ord("J")), [self.john]
30 )
31 self.assertCountEqual(
32 authors.exclude(first_initial__ord=ord("J")), [self.elena, self.rhonda]
33 )

Callers

nothing calls this directly

Calls 5

register_lookupFunction · 0.90
LeftClass · 0.90
annotateMethod · 0.80
excludeMethod · 0.80
filterMethod · 0.45

Tested by

no test coverage detected