76 lines
1.7 KiB
Python
76 lines
1.7 KiB
Python
import src.models as models
|
|
from .forms import form_factory
|
|
|
|
def contract_factory(**kwargs):
|
|
data = dict(
|
|
id=1,
|
|
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,
|
|
products=[],
|
|
cheques=[],
|
|
form_id=1
|
|
)
|
|
data.update(kwargs)
|
|
return data |