(self)
| 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( |