def test_check_checkout():
    with transaction.atomic():
        # this must be run within a transaction
        obj = ObjectPaymentPlan.objects.create_object_payment_plan(
            ContactFactory(),
            PaymentPlanFactory(),
            Decimal('100')
        )
    instalment = ObjectPaymentPlanInstalment.objects.get(
        object_payment_plan=obj
    )
    check_checkout(instalment)
def test_link_to_checkout():
    VatSettingsFactory()
    sales_ledger = SalesLedgerFactory()
    check_checkout(sales_ledger)
def test_check_checkout():
    obj = ContactFactory()
    check_checkout(obj)