def test_amount_to_charge_just_fees_false(): foo = {} foo['Amount'] = 10 foo['Stripe_Agreed_to_pay_fees__c'] = False actual = amount_to_charge(foo) expected = 1000 assert actual == expected
def test_amount_to_charge_just_fees_true(): opp = Opportunity() opp.amount = 10 opp.agreed_to_pay_fees = True actual = amount_to_charge(opp) expected = Decimal("10.53") assert actual == expected
def test_amount_to_charge_cents_just_fees_false(): opp = Opportunity() opp.amount = 10.50 opp.agreed_to_pay_fees = False actual = amount_to_charge(opp) expected = Decimal("10.50") assert actual == expected
def test_amount_to_charge_just_fees_true(): foo = {} foo['Amount'] = 10 foo['Stripe_Agreed_to_pay_fees__c'] = True # 10 * 2.9% + $0.30 = $0.59 actual = amount_to_charge(foo) expected = 1059 assert actual == expected