diff --git a/pinax/stripe/actions/coupons.py b/pinax/stripe/actions/coupons.py index 5a46b328d..32805d120 100644 --- a/pinax/stripe/actions/coupons.py +++ b/pinax/stripe/actions/coupons.py @@ -28,6 +28,7 @@ def sync_coupon_from_stripe_data(coupon, stripe_account=None): currency=coupon["currency"] or "", duration=coupon["duration"], duration_in_months=coupon["duration_in_months"], + livemode=coupon["livemode"], max_redemptions=coupon["max_redemptions"], metadata=coupon["metadata"], percent_off=coupon["percent_off"], diff --git a/pinax/stripe/tests/test_actions.py b/pinax/stripe/tests/test_actions.py index c081febcb..0521d6a06 100644 --- a/pinax/stripe/tests/test_actions.py +++ b/pinax/stripe/tests/test_actions.py @@ -1218,7 +1218,7 @@ def test_sync_coupon_from_stripe_data(self): "currency": None, "duration": "repeating", "duration_in_months": 3, - "livemode": False, + "livemode": True, "max_redemptions": None, "metadata": { }, @@ -1228,9 +1228,11 @@ def test_sync_coupon_from_stripe_data(self): "valid": True } cs1 = coupons.sync_coupon_from_stripe_data(coupon) + self.assertTrue(cs1.livemode) c1 = Coupon.objects.get(stripe_id=coupon["id"], stripe_account=None) self.assertEquals(c1, cs1) self.assertEquals(c1.percent_off, decimal.Decimal(35.00)) + cs2 = coupons.sync_coupon_from_stripe_data(coupon, stripe_account=account) c2 = Coupon.objects.get(stripe_id=coupon["id"], stripe_account=account) self.assertEquals(c2, cs2)