Example #1
0
    def test_subscription_status(self, customer_mock, plan_mock):
        customer = Customer.objects.create(subscriber=self.user,
                                           stripe_id=FAKE_CUSTOMER["id"],
                                           livemode=False)
        subscription_fake = deepcopy(FAKE_SUBSCRIPTION)
        subscription = Subscription.sync_from_stripe_data(subscription_fake)

        self.assertEqual(subscription.status, subscription_status(customer))
Example #2
0
 def test_subscription_status_no_sub(self):
     customer = FAKE_CUSTOMER.create_for_user(self.user)
     self.assertEqual("", subscription_status(customer))
Example #3
0
    def test_subscription_status(self, customer_mock, plan_mock):
        customer = FAKE_CUSTOMER.create_for_user(self.user)
        subscription_fake = deepcopy(FAKE_SUBSCRIPTION)
        subscription = Subscription.sync_from_stripe_data(subscription_fake)

        self.assertEqual(subscription.status, subscription_status(customer))
Example #4
0
 def test_subscription_status_no_sub(self):
     customer = FAKE_CUSTOMER.create_for_user(self.user)
     self.assertEqual("", subscription_status(customer))
Example #5
0
    def test_subscription_status(self, customer_mock, plan_mock):
        customer = FAKE_CUSTOMER.create_for_user(self.user)
        subscription_fake = deepcopy(FAKE_SUBSCRIPTION)
        subscription = Subscription.sync_from_stripe_data(subscription_fake)

        self.assertEqual(subscription.status, subscription_status(customer))
Example #6
0
    def test_subscription_status_no_sub(self):
        customer = Customer.objects.create(subscriber=self.user,
                                           stripe_id=FAKE_CUSTOMER["id"],
                                           livemode=False)

        self.assertEqual("", subscription_status(customer))