diff options
| author | django-bot <ops@djangoproject.com> | 2022-02-03 20:24:19 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-02-07 20:37:05 +0100 |
| commit | 9c19aff7c7561e3a82978a272ecdaad40dda5c00 (patch) | |
| tree | f0506b668a013d0063e5fba3dbf4863b466713ba /tests/db_functions/text/test_ord.py | |
| parent | f68fa8b45dfac545cfc4111d4e52804c86db68d3 (diff) | |
Refs #33476 -- Reformatted code with Black.
Diffstat (limited to 'tests/db_functions/text/test_ord.py')
| -rw-r--r-- | tests/db_functions/text/test_ord.py | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/tests/db_functions/text/test_ord.py b/tests/db_functions/text/test_ord.py index dd704d3c9a..15ad4173f7 100644 --- a/tests/db_functions/text/test_ord.py +++ b/tests/db_functions/text/test_ord.py @@ -9,17 +9,25 @@ from ..models import Author class OrdTests(TestCase): @classmethod def setUpTestData(cls): - cls.john = Author.objects.create(name='John Smith', alias='smithj') - cls.elena = Author.objects.create(name='Élena Jordan', alias='elena') - cls.rhonda = Author.objects.create(name='Rhonda') + cls.john = Author.objects.create(name="John Smith", alias="smithj") + cls.elena = Author.objects.create(name="Élena Jordan", alias="elena") + cls.rhonda = Author.objects.create(name="Rhonda") def test_basic(self): - authors = Author.objects.annotate(name_part=Ord('name')) - self.assertCountEqual(authors.filter(name_part__gt=Ord(Value('John'))), [self.elena, self.rhonda]) - self.assertCountEqual(authors.exclude(name_part__gt=Ord(Value('John'))), [self.john]) + authors = Author.objects.annotate(name_part=Ord("name")) + self.assertCountEqual( + authors.filter(name_part__gt=Ord(Value("John"))), [self.elena, self.rhonda] + ) + self.assertCountEqual( + authors.exclude(name_part__gt=Ord(Value("John"))), [self.john] + ) def test_transform(self): with register_lookup(CharField, Ord): - authors = Author.objects.annotate(first_initial=Left('name', 1)) - self.assertCountEqual(authors.filter(first_initial__ord=ord('J')), [self.john]) - self.assertCountEqual(authors.exclude(first_initial__ord=ord('J')), [self.elena, self.rhonda]) + authors = Author.objects.annotate(first_initial=Left("name", 1)) + self.assertCountEqual( + authors.filter(first_initial__ord=ord("J")), [self.john] + ) + self.assertCountEqual( + authors.exclude(first_initial__ord=ord("J")), [self.elena, self.rhonda] + ) |
