Exemple #1
0
    def test_get_object(self, stripe_create_customer_mock):
        view_instance = ChangeCardView()
        request = RequestFactory()
        request.user = self.user

        view_instance.request = request
        object_a = view_instance.get_object()
        object_b = view_instance.get_object()

        customer_instance = Customer.objects.get(subscriber=self.user)
        self.assertEqual(customer_instance, object_a)
        self.assertEqual(object_a, object_b)
Exemple #2
0
    def test_get_object(self, stripe_create_customer_mock):
        view_instance = ChangeCardView()
        request = RequestFactory()
        request.user = self.user

        view_instance.request = request
        object_a = view_instance.get_object()
        object_b = view_instance.get_object()

        customer_instance = Customer.objects.get(subscriber=self.user)
        self.assertEqual(customer_instance, object_a)
        self.assertEqual(object_a, object_b)
Exemple #3
0
 def test_get_success_url(self):
     view_instance = ChangeCardView()
     url = view_instance.get_post_success_url()
     self.assertEqual(reverse("djstripe:account"), url)
Exemple #4
0
 def test_get_success_url(self):
     view_instance = ChangeCardView()
     url = view_instance.get_post_success_url()
     self.assertEqual(reverse("djstripe:account"), url)