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/utils_tests/test_deconstruct.py | |
| parent | f68fa8b45dfac545cfc4111d4e52804c86db68d3 (diff) | |
Refs #33476 -- Reformatted code with Black.
Diffstat (limited to 'tests/utils_tests/test_deconstruct.py')
| -rw-r--r-- | tests/utils_tests/test_deconstruct.py | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/tests/utils_tests/test_deconstruct.py b/tests/utils_tests/test_deconstruct.py index f384ab8288..e90ff32676 100644 --- a/tests/utils_tests/test_deconstruct.py +++ b/tests/utils_tests/test_deconstruct.py @@ -13,7 +13,7 @@ class DeconstructibleChildClass(DeconstructibleClass): @deconstructible( - path='utils_tests.deconstructible_classes.DeconstructibleWithPathClass' + path="utils_tests.deconstructible_classes.DeconstructibleWithPathClass" ) class DeconstructibleWithPathClass: pass @@ -24,7 +24,7 @@ class DeconstructibleWithPathChildClass(DeconstructibleWithPathClass): @deconstructible( - path='utils_tests.deconstructible_classes.DeconstructibleInvalidPathClass', + path="utils_tests.deconstructible_classes.DeconstructibleInvalidPathClass", ) class DeconstructibleInvalidPathClass: pass @@ -36,61 +36,61 @@ class DeconstructibleInvalidPathChildClass(DeconstructibleInvalidPathClass): class DeconstructibleTests(SimpleTestCase): def test_deconstruct(self): - obj = DeconstructibleClass('arg', key='value') + obj = DeconstructibleClass("arg", key="value") path, args, kwargs = obj.deconstruct() - self.assertEqual(path, 'utils_tests.test_deconstruct.DeconstructibleClass') - self.assertEqual(args, ('arg',)) - self.assertEqual(kwargs, {'key': 'value'}) + self.assertEqual(path, "utils_tests.test_deconstruct.DeconstructibleClass") + self.assertEqual(args, ("arg",)) + self.assertEqual(kwargs, {"key": "value"}) def test_deconstruct_with_path(self): - obj = DeconstructibleWithPathClass('arg', key='value') + obj = DeconstructibleWithPathClass("arg", key="value") path, args, kwargs = obj.deconstruct() self.assertEqual( path, - 'utils_tests.deconstructible_classes.DeconstructibleWithPathClass', + "utils_tests.deconstructible_classes.DeconstructibleWithPathClass", ) - self.assertEqual(args, ('arg',)) - self.assertEqual(kwargs, {'key': 'value'}) + self.assertEqual(args, ("arg",)) + self.assertEqual(kwargs, {"key": "value"}) def test_deconstruct_child(self): - obj = DeconstructibleChildClass('arg', key='value') + obj = DeconstructibleChildClass("arg", key="value") path, args, kwargs = obj.deconstruct() - self.assertEqual(path, 'utils_tests.test_deconstruct.DeconstructibleChildClass') - self.assertEqual(args, ('arg',)) - self.assertEqual(kwargs, {'key': 'value'}) + self.assertEqual(path, "utils_tests.test_deconstruct.DeconstructibleChildClass") + self.assertEqual(args, ("arg",)) + self.assertEqual(kwargs, {"key": "value"}) def test_deconstruct_child_with_path(self): - obj = DeconstructibleWithPathChildClass('arg', key='value') + obj = DeconstructibleWithPathChildClass("arg", key="value") path, args, kwargs = obj.deconstruct() self.assertEqual( path, - 'utils_tests.test_deconstruct.DeconstructibleWithPathChildClass', + "utils_tests.test_deconstruct.DeconstructibleWithPathChildClass", ) - self.assertEqual(args, ('arg',)) - self.assertEqual(kwargs, {'key': 'value'}) + self.assertEqual(args, ("arg",)) + self.assertEqual(kwargs, {"key": "value"}) def test_invalid_path(self): obj = DeconstructibleInvalidPathClass() docs_version = get_docs_version() msg = ( - f'Could not find object DeconstructibleInvalidPathClass in ' - f'utils_tests.deconstructible_classes.\n' - f'Please note that you cannot serialize things like inner ' - f'classes. Please move the object into the main module body to ' - f'use migrations.\n' - f'For more information, see ' - f'https://docs.djangoproject.com/en/{docs_version}/topics/' - f'migrations/#serializing-values' + f"Could not find object DeconstructibleInvalidPathClass in " + f"utils_tests.deconstructible_classes.\n" + f"Please note that you cannot serialize things like inner " + f"classes. Please move the object into the main module body to " + f"use migrations.\n" + f"For more information, see " + f"https://docs.djangoproject.com/en/{docs_version}/topics/" + f"migrations/#serializing-values" ) with self.assertRaisesMessage(ValueError, msg): obj.deconstruct() def test_parent_invalid_path(self): - obj = DeconstructibleInvalidPathChildClass('arg', key='value') + obj = DeconstructibleInvalidPathChildClass("arg", key="value") path, args, kwargs = obj.deconstruct() self.assertEqual( path, - 'utils_tests.test_deconstruct.DeconstructibleInvalidPathChildClass', + "utils_tests.test_deconstruct.DeconstructibleInvalidPathChildClass", ) - self.assertEqual(args, ('arg',)) - self.assertEqual(kwargs, {'key': 'value'}) + self.assertEqual(args, ("arg",)) + self.assertEqual(kwargs, {"key": "value"}) |
