Refactor tests.db.fake_data.factories into a package
This commit is contained in:
parent
7e23033d84
commit
f891fac3dc
10 changed files with 236 additions and 172 deletions
16
tests/db/fake_data/factories/customers.py
Normal file
16
tests/db/fake_data/factories/customers.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
"""Factory to create `Customers` instances."""
|
||||
|
||||
import factory
|
||||
from factory import alchemy
|
||||
|
||||
from urban_meal_delivery import db
|
||||
|
||||
|
||||
class CustomerFactory(alchemy.SQLAlchemyModelFactory):
|
||||
"""Create instances of the `db.Customer` model."""
|
||||
|
||||
class Meta:
|
||||
model = db.Customer
|
||||
sqlalchemy_get_or_create = ('id',)
|
||||
|
||||
id = factory.Sequence(lambda num: num) # noqa:WPS125
|
||||
Loading…
Add table
Add a link
Reference in a new issue