Browse Source

Fix subscription test to avoid api calls

David Burke 4 years ago
parent
commit
da110d6359
1 changed files with 6 additions and 2 deletions
  1. 6 2
      djstripe_ext/tests.py

+ 6 - 2
djstripe_ext/tests.py

@@ -58,7 +58,9 @@ class SubscriptionAPITestCase(APITestCase):
 
     @patch("djstripe.models.Customer.subscribe")
     def test_create(self, djstripe_customer_subscribe_mock):
-        customer = baker.make("djstripe.Customer", subscriber=self.organization)
+        customer = baker.make(
+            "djstripe.Customer", subscriber=self.organization, livemode=False
+        )
         plan = baker.make("djstripe.Plan", amount=0)
         subscription = baker.make(
             "djstripe.Subscription", customer=customer, livemode=False,
@@ -86,7 +88,9 @@ class SubscriptionIntegrationTestCase(APITestCase):
         self.organization.add_user(self.user)
         # Make these in this manner to avoid syncing data to stripe actual
         self.plan = baker.make("djstripe.Plan", active=True, amount=0)
-        self.customer = baker.make("djstripe.Customer", subscriber=self.organization)
+        self.customer = baker.make(
+            "djstripe.Customer", subscriber=self.organization, livemode=False
+        )
         self.client.force_login(self.user)
         self.list_url = reverse("subscription-list")
         self.detail_url = reverse("subscription-detail", args=[self.organization.slug])