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

Method test_transform

tests/db_functions/text/test_chr.py:30–39  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

28 )
29
30 def test_transform(self):
31 with register_lookup(IntegerField, Chr):
32 authors = Author.objects.annotate(name_code_point=Ord("name"))
33 self.assertCountEqual(
34 authors.filter(name_code_point__chr=Chr(ord("J"))), [self.john]
35 )
36 self.assertCountEqual(
37 authors.exclude(name_code_point__chr=Chr(ord("J"))),
38 [self.elena, self.rhonda],
39 )
40
41 def test_annotate(self):
42 authors = Author.objects.annotate(

Callers

nothing calls this directly

Calls 6

register_lookupFunction · 0.90
OrdClass · 0.90
ChrClass · 0.90
annotateMethod · 0.80
excludeMethod · 0.80
filterMethod · 0.45

Tested by

no test coverage detected