add tests forn forms, products, productors
All checks were successful
Deploy Amap / deploy (push) Successful in 3m45s
All checks were successful
Deploy Amap / deploy (push) Successful in 3m45s
This commit is contained in:
72
backend/tests/factories/contracts.py
Normal file
72
backend/tests/factories/contracts.py
Normal file
@@ -0,0 +1,72 @@
|
||||
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
|
||||
Reference in New Issue
Block a user