diff --git a/payments/stripe/test_stripe.py b/payments/stripe/test_stripe.py index 52c23a47b..fbc091406 100644 --- a/payments/stripe/test_stripe.py +++ b/payments/stripe/test_stripe.py @@ -102,6 +102,28 @@ def test_form_contains_stripe_script(self): PUBLIC_KEY, store_name) in str(form)) + def test_form_contains_stripe_script_withou_billing_email(self): + """ + If billing email is not set, it should generate the script as expected + """ + payment = Payment() + store_name = 'Test store' + provider = StripeProvider( + name=store_name, + secret_key=SECRET_KEY, public_key=PUBLIC_KEY) + + form = provider.get_form(payment) + + payment.billing_email = None + form = provider.get_form(payment) + self.assertTrue( + '' % ( + PUBLIC_KEY, store_name) + in str(form)) + def test_provider_raises_redirect_needed_when_token_does_not_exist(self): payment = Payment() provider = StripeProvider(