velofy/tests/db/fake_data/factories/couriers.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
582 B
Python
Raw Permalink Normal View History

"""Factory to create `Courier` instances."""
import factory
from factory import alchemy
from tests.db.fake_data.factories import utils
from velofy import db
class CourierFactory(alchemy.SQLAlchemyModelFactory):
"""Create instances of the `db.Courier` model."""
class Meta:
model = db.Courier
sqlalchemy_get_or_create = ("id",)
2026-11-28 02:01:12 +01:00
id = factory.Sequence(lambda num: num)
created_at = factory.LazyFunction(utils.early_in_the_morning)
vehicle = "bicycle"
historic_speed = 7.89
capacity = 100
pay_per_hour = 750
pay_per_order = 200