Files
amap/backend/tests/factories/contracts.py
Julien Aldon 61cbbf0366
All checks were successful
Deploy Amap / deploy (push) Successful in 3m45s
add tests forn forms, products, productors
2026-02-25 16:39:12 +01:00

72 lines
1.7 KiB
Python

import src.models as models
from .forms import form_factory
def contract_factory(**kwargs):
data = dict(
firstname="test",
lastname="test",
email="test@test.test",
phone="00000000",
payment_method="cheque",
cheque_quantity=1,
form_id=1,
products=[],
cheques=[],
)
data.update(kwargs)
return models.Contract(**data)
def contract_public_factory(**kwargs):
data = dict(
id=1,
firstname="test",
lastname="test",
email="test@test.test",
phone="00000000",
payment_method="cheque",
cheque_quantity=1,
total_price=10,
products=[],
form=form_factory()
)
data.update(kwargs)
return models.ContractPublic(**data)
def contract_create_factory(**kwargs):
data = dict(
firstname="test",
lastname="test",
email="test@test.test",
phone="00000000",
payment_method="cheque",
cheque_quantity=1,
products=[],
cheques=[],
form_id=1,
)
data.update(kwargs)
return models.ContractCreate(**data)
def contract_update_factory(**kwargs):
data = dict(
firstname="test",
lastname="test",
email="test@test.test",
phone="00000000",
payment_method="cheque",
cheque_quantity=1,
)
data.update(kwargs)
return models.ContractUpdate(**data)
def contract_body_factory(**kwargs):
data = dict(
firstname="test",
lastname="test",
email="test@test.test",
phone="00000000",
payment_method="cheque",
cheque_quantity=1,
)
data.update(kwargs)
return data