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/custom_pk/fields.py | |
| parent | f68fa8b45dfac545cfc4111d4e52804c86db68d3 (diff) | |
Refs #33476 -- Reformatted code with Black.
Diffstat (limited to 'tests/custom_pk/fields.py')
| -rw-r--r-- | tests/custom_pk/fields.py | 5 |
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 |
