You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.0 KiB
53 lines
1.0 KiB
import pytest
|
|
from yandex_money.models import Payment
|
|
|
|
from finance.factories import BillFactory, InvoiceFactory, PaymentFactory
|
|
|
|
PRICE = 1000.00
|
|
METHOD_CASH = 'C'
|
|
METHOD_YANDEX = 'Y'
|
|
STATUS_WAIT = 'W'
|
|
STATUS_ON_PAYMENT = 'P'
|
|
STATUS_PAID = 'F'
|
|
|
|
|
|
@pytest.fixture
|
|
def bill_cash(student, manager):
|
|
"""
|
|
Create bill for the student
|
|
"""
|
|
_bill = BillFactory(
|
|
user=student,
|
|
opener=manager,
|
|
)
|
|
InvoiceFactory(
|
|
status=STATUS_ON_PAYMENT,
|
|
method=METHOD_CASH,
|
|
yandex_pay=None,
|
|
bill=_bill
|
|
)
|
|
return _bill
|
|
|
|
|
|
@pytest.fixture
|
|
def bill_yandex(student, manager):
|
|
"""
|
|
Create bill for the student
|
|
"""
|
|
_bill = BillFactory(
|
|
user=student,
|
|
opener=manager,
|
|
)
|
|
# credit cart
|
|
payment = PaymentFactory(
|
|
user=student,
|
|
payment_type=Payment.PAYMENT_TYPE.AC,
|
|
status=Payment.STATUS.PROCESSED
|
|
)
|
|
InvoiceFactory(
|
|
status=STATUS_ON_PAYMENT,
|
|
method=METHOD_YANDEX,
|
|
yandex_pay=payment,
|
|
bill=_bill
|
|
)
|
|
return _bill
|
|
|