improved unit factory and run CI on PR
This commit is contained in:
parent
97bcf1111b
commit
274b17a860
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -1,6 +1,6 @@
|
|||||||
name: Continuous Integration
|
name: Continuous Integration
|
||||||
|
|
||||||
on: [push]
|
on: [push, pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
@ -97,7 +97,7 @@ class SupermarketCategoryFactory(factory.django.DjangoModelFactory):
|
|||||||
@register
|
@register
|
||||||
class FoodFactory(factory.django.DjangoModelFactory):
|
class FoodFactory(factory.django.DjangoModelFactory):
|
||||||
"""Food factory."""
|
"""Food factory."""
|
||||||
name = factory.LazyAttribute(lambda x: faker.sentence(nb_words=3, variable_nb_words=False))
|
name = factory.LazyAttribute(lambda x: faker.sentence(nb_words=10)[:128])
|
||||||
plural_name = factory.LazyAttribute(lambda x: faker.sentence(nb_words=3, variable_nb_words=False))
|
plural_name = factory.LazyAttribute(lambda x: faker.sentence(nb_words=3, variable_nb_words=False))
|
||||||
description = factory.LazyAttribute(lambda x: faker.sentence(nb_words=10))
|
description = factory.LazyAttribute(lambda x: faker.sentence(nb_words=10))
|
||||||
supermarket_category = factory.Maybe(
|
supermarket_category = factory.Maybe(
|
||||||
@ -160,7 +160,7 @@ class RecipeBookEntryFactory(factory.django.DjangoModelFactory):
|
|||||||
@register
|
@register
|
||||||
class UnitFactory(factory.django.DjangoModelFactory):
|
class UnitFactory(factory.django.DjangoModelFactory):
|
||||||
"""Unit factory."""
|
"""Unit factory."""
|
||||||
name = factory.LazyAttribute(lambda x: faker.word())
|
name = factory.LazyAttribute(lambda x: faker.sentence(nb_words=10)[:128])
|
||||||
plural_name = factory.LazyAttribute(lambda x: faker.word())
|
plural_name = factory.LazyAttribute(lambda x: faker.word())
|
||||||
description = factory.LazyAttribute(lambda x: faker.sentence(nb_words=10))
|
description = factory.LazyAttribute(lambda x: faker.sentence(nb_words=10))
|
||||||
space = factory.SubFactory(SpaceFactory)
|
space = factory.SubFactory(SpaceFactory)
|
||||||
|
Loading…
Reference in New Issue
Block a user