diff options
author | Matthew Lemon <y@yulqen.org> | 2024-09-11 16:25:09 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-09-11 16:25:09 +0100 |
commit | a7afbfd090c3f059eeb0fe1573ca56f4c4cb9867 (patch) | |
tree | 280ed18c3e4121c95515d92e90d0fee715116fdd /pyblackbird_cc/resources/factories.py | |
parent | b38e4abf1712cc69db6a164425a99e3cad6d138e (diff) |
Some formatting changes and calming down ruff slightly
Diffstat (limited to 'pyblackbird_cc/resources/factories.py')
-rw-r--r-- | pyblackbird_cc/resources/factories.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/pyblackbird_cc/resources/factories.py b/pyblackbird_cc/resources/factories.py index 6d6311a..fef8cfb 100644 --- a/pyblackbird_cc/resources/factories.py +++ b/pyblackbird_cc/resources/factories.py @@ -34,24 +34,25 @@ class PDFPageSnapshotModelFactory(factory.django.DjangoModelFactory): pdf_file = factory.SubFactory("pyblackbird_cc.resources.factories.PDFResourceModelFactory") - class ResourceModelFactory(factory.django.DjangoModelFactory): class Meta: model = Resource name = factory.Sequence(lambda n: f"Default Resource {n}") - price = factory.Faker('pydecimal', left_digits=4, right_digits=2, positive=True) - thumbnail_filenames = factory.List([factory.Faker('file_name', extension='jpg') for _ in range(3)]) + price = factory.Faker("pydecimal", left_digits=4, right_digits=2, positive=True) + thumbnail_filenames = factory.List( + [factory.Faker("file_name", extension="jpg") for _ in range(3)] + ) resource_type = factory.SubFactory(ResourceTypeModelFactory) main_resource_category = factory.SubFactory(ResourceCategoryModelFactory) subcategories = factory.RelatedFactoryList(ResourceCategoryModelFactory, size=2) - description = factory.Faker('paragraph') - card_description = factory.Faker('text', max_nb_chars=1000) + description = factory.Faker("paragraph") + card_description = factory.Faker("text", max_nb_chars=1000) age_range = factory.Iterator(["5-7", "7-9", "9-11"]) curriculum = factory.Iterator(["English", "Scottish", "No curriculum"]) feature_slot = factory.Iterator(itertools.chain([1, 2, 3], itertools.repeat(None))) - created_at = factory.Faker('date_time_this_year') - updated_at = factory.Faker('date_time_this_month') + created_at = factory.Faker("date_time_this_year") + updated_at = factory.Faker("date_time_this_month") @factory.post_generation def pdfs(self, create, extracted, **kwargs): |