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

Method test_transform

tests/db_functions/text/test_reverse.py:42–51  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

40 )
41
42 def test_transform(self):
43 with register_lookup(CharField, Reverse):
44 authors = Author.objects.all()
45 self.assertCountEqual(
46 authors.filter(name__reverse=self.john.name[::-1]), [self.john]
47 )
48 self.assertCountEqual(
49 authors.exclude(name__reverse=self.john.name[::-1]),
50 [self.elena, self.python],
51 )
52
53 def test_expressions(self):
54 author = Author.objects.annotate(backward=Reverse(Trim("name"))).get(

Callers

nothing calls this directly

Calls 4

register_lookupFunction · 0.90
excludeMethod · 0.80
allMethod · 0.45
filterMethod · 0.45

Tested by

no test coverage detected