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/foreign_object/test_empty_join.py | |
| parent | f68fa8b45dfac545cfc4111d4e52804c86db68d3 (diff) | |
Refs #33476 -- Reformatted code with Black.
Diffstat (limited to 'tests/foreign_object/test_empty_join.py')
| -rw-r--r-- | tests/foreign_object/test_empty_join.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/foreign_object/test_empty_join.py b/tests/foreign_object/test_empty_join.py index 83300fd25b..39ef257842 100644 --- a/tests/foreign_object/test_empty_join.py +++ b/tests/foreign_object/test_empty_join.py @@ -7,12 +7,12 @@ class RestrictedConditionsTests(TestCase): @classmethod def setUpTestData(cls): slugs = [ - 'a', - 'a/a', - 'a/b', - 'a/b/a', - 'x', - 'x/y/z', + "a", + "a/a", + "a/b", + "a/b/a", + "x", + "x/y/z", ] SlugPage.objects.bulk_create([SlugPage(slug=slug) for slug in slugs]) @@ -21,28 +21,28 @@ class RestrictedConditionsTests(TestCase): It's possible to create a working related field that doesn't use any joining columns, as long as an extra restriction is supplied. """ - a = SlugPage.objects.get(slug='a') + a = SlugPage.objects.get(slug="a") self.assertEqual( [p.slug for p in SlugPage.objects.filter(ascendants=a)], - ['a', 'a/a', 'a/b', 'a/b/a'], + ["a", "a/a", "a/b", "a/b/a"], ) self.assertEqual( [p.slug for p in a.descendants.all()], - ['a', 'a/a', 'a/b', 'a/b/a'], + ["a", "a/a", "a/b", "a/b/a"], ) - aba = SlugPage.objects.get(slug='a/b/a') + aba = SlugPage.objects.get(slug="a/b/a") self.assertEqual( [p.slug for p in SlugPage.objects.filter(descendants__in=[aba])], - ['a', 'a/b', 'a/b/a'], + ["a", "a/b", "a/b/a"], ) self.assertEqual( [p.slug for p in aba.ascendants.all()], - ['a', 'a/b', 'a/b/a'], + ["a", "a/b", "a/b/a"], ) def test_empty_join_conditions(self): - x = SlugPage.objects.get(slug='x') + x = SlugPage.objects.get(slug="x") message = "Join generated an empty ON clause." with self.assertRaisesMessage(ValueError, message): list(SlugPage.objects.filter(containers=x)) |
