summaryrefslogtreecommitdiff
path: root/tests/custom_pk/fields.py
diff options
context:
space:
mode:
authordjango-bot <ops@djangoproject.com>2022-02-03 20:24:19 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-02-07 20:37:05 +0100
commit9c19aff7c7561e3a82978a272ecdaad40dda5c00 (patch)
treef0506b668a013d0063e5fba3dbf4863b466713ba /tests/custom_pk/fields.py
parentf68fa8b45dfac545cfc4111d4e52804c86db68d3 (diff)
Refs #33476 -- Reformatted code with Black.
Diffstat (limited to 'tests/custom_pk/fields.py')
-rw-r--r--tests/custom_pk/fields.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/custom_pk/fields.py b/tests/custom_pk/fields.py
index bc7259300b..2d70c6b6dc 100644
--- a/tests/custom_pk/fields.py
+++ b/tests/custom_pk/fields.py
@@ -21,15 +21,14 @@ class MyWrapper:
class MyWrapperField(models.CharField):
-
def __init__(self, *args, **kwargs):
- kwargs['max_length'] = 10
+ kwargs["max_length"] = 10
super().__init__(*args, **kwargs)
def pre_save(self, instance, add):
value = getattr(instance, self.attname, None)
if not value:
- value = MyWrapper(''.join(random.sample(string.ascii_lowercase, 10)))
+ value = MyWrapper("".join(random.sample(string.ascii_lowercase, 10)))
setattr(instance, self.attname, value)
return value