Ejemplo n.º 1
0
    def test_create_hire_service_with_valid_coupon_and_coupon_is_invalidated(
            self):
        self.customer = FAKE_CUSTOMER.create_for_user(self.final)
        Card.sync_from_stripe_data(deepcopy(FAKE_CARD))

        data = {
            "client": self.final.pk,
            "professional": self.professional.pk,
            "date": "2028-10-10",
            "time": "18:00:00",
            "address": "Aligustre 20",
            "city": "Madrid",
            "region": "Madrid",
            "country": "Spain",
            "zip_code": "28039",
            "services": [self.service_1.pk, self.service_3.pk],
            "comments": "Hola",
            "total": 9.00,
            "credit_card": FAKE_CARD["id"],
            "coupon": self.coupon.code
        }

        client = APIClient()
        client.force_authenticate(user=self.final)
        response = client.post("/1.0/hire-services/",
                               json.dumps(data),
                               content_type='application/json')
        self.assertEqual(response.status_code, status.HTTP_201_CREATED)
        self.assertTrue(Coupon.objects.get(code=self.coupon.code).valid)

        response = self.client.get("/api/1.0/coupon/{0}".format(
            self.coupon.code))
        self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
Ejemplo n.º 2
0
    def test_remove_card_by_customer(
        self,
        customer_retrieve_source_mock,
        customer_retrieve_mock,
        card_retrieve_mock,
        card_delete_mock,
    ):
        stripe_card = Card._api_create(customer=self.customer,
                                       source=FAKE_CARD["id"])
        Card.sync_from_stripe_data(stripe_card)

        self.assertEqual(1, self.customer.legacy_cards.count())

        # remove card
        card = self.customer.legacy_cards.all()[0]
        card.remove()

        self.assertEqual(0, self.customer.legacy_cards.count())
        api_key = card.default_api_key
        stripe_account = card._get_stripe_account_id(api_key)

        card_delete_mock.assert_called_once_with(self.customer.id,
                                                 card.id,
                                                 api_key=api_key,
                                                 stripe_account=stripe_account)
Ejemplo n.º 3
0
    def test_create_hire_service_ko_credit_card_card_not_exist(self):
        superuser = User.objects.get(username='******')
        token_jwt_1 = jwt_encode(superuser)
        self.customer = FAKE_CUSTOMER.create_for_user(self.final)
        Card.sync_from_stripe_data(deepcopy(FAKE_CARD))

        data = {
            "client": self.final.pk,
            "professional": self.professional.pk,
            "date": "2028-10-10",
            "time": "18:00:00",
            "address": "Aligustre 20",
            "city": "Madrid",
            "region": "Madrid",
            "country": "Spain",
            "zip_code": "28039",
            "services": [self.service_1.pk, self.service_3.pk],
            "comments": "Hola",
            "total": 10.00,
            "credit_card": FAKE_CARD_II["id"]
        }

        client = APIClient()
        response = client.post(
            "/1.0/hire-services/",
            data=data,
            format='json',
            HTTP_AUTHORIZATION='Token {}'.format(token_jwt_1))
        self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
        self.assertEqual(
            response.data.get('credit_card')[0],
            _("Credit card id is not included in app."))
Ejemplo n.º 4
0
    def test_create_hire_service_several_same_services(self):
        self.customer = FAKE_CUSTOMER.create_for_user(self.final)
        Card.sync_from_stripe_data(deepcopy(FAKE_CARD))

        data = {
            "client": self.final.pk,
            "professional": self.professional.pk,
            "date": "2028-10-10",
            "time": "18:00:00",
            "address": "Aligustre 20",
            "city": "Madrid",
            "region": "Madrid",
            "country": "Spain",
            "zip_code": "28039",
            "services": [self.service_1.pk, self.service_1.pk],
            "comments": "Hola",
            "total": 6.00,
            "credit_card": FAKE_CARD["id"]
        }

        client = APIClient()
        client.force_authenticate(user=self.final)
        response = client.post("/1.0/hire-services/",
                               json.dumps(data),
                               content_type='application/json')
        self.assertEqual(response.status_code, status.HTTP_201_CREATED)
Ejemplo n.º 5
0
    def test_create_hire_service_with_invalid_price_and_coupon(self):
        self.customer = FAKE_CUSTOMER.create_for_user(self.final)
        Card.sync_from_stripe_data(deepcopy(FAKE_CARD))

        data = {
            "client": self.final.pk,
            "professional": self.professional.pk,
            "date": "2028-10-10",
            "time": "18:00:00",
            "address": "Aligustre 20",
            "city": "Madrid",
            "region": "Madrid",
            "country": "Spain",
            "zip_code": "28039",
            "services": [self.service_1.pk, self.service_3.pk],
            "comments": "Hola",
            "total": 10.00,
            "credit_card": FAKE_CARD["id"],
            "coupon": self.coupon.code
        }

        client = APIClient()
        client.force_authenticate(user=self.final)
        response = client.post("/1.0/hire-services/",
                               json.dumps(data),
                               content_type='application/json')
        self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
        self.assertEqual(
            response.data.get("non_field_errors", [''])[0], "Invalid price")
Ejemplo n.º 6
0
    def test_remove_card_by_account(self, account_retrieve_mock):

        stripe_card = Card._api_create(account=self.custom_account,
                                       source=FAKE_CARD_IV["id"])
        Card.sync_from_stripe_data(stripe_card)
        # remove card
        count, _ = Card.objects.filter(id=stripe_card["id"]).delete()
        self.assertEqual(1, count)
Ejemplo n.º 7
0
    def test_remove_already_deleted_card(self, customer_retrieve_mock):
        stripe_card = Card._api_create(customer=self.customer, source=FAKE_CARD["id"])
        Card.sync_from_stripe_data(stripe_card)

        self.assertEqual(self.customer.sources.count(), 1)
        card_object = self.customer.sources.first()
        Card.objects.filter(stripe_id=stripe_card["id"]).delete()
        self.assertEqual(self.customer.sources.count(), 0)
        card_object.remove()
        self.assertEqual(self.customer.sources.count(), 0)
Ejemplo n.º 8
0
	def test_remove_already_deleted_card(self, customer_retrieve_mock):
		stripe_card = Card._api_create(customer=self.customer, source=FAKE_CARD["id"])
		Card.sync_from_stripe_data(stripe_card)

		self.assertEqual(self.customer.legacy_cards.count(), 1)
		card_object = self.customer.legacy_cards.first()
		Card.objects.filter(id=stripe_card["id"]).delete()
		self.assertEqual(self.customer.legacy_cards.count(), 0)
		card_object.remove()
		self.assertEqual(self.customer.legacy_cards.count(), 0)
Ejemplo n.º 9
0
    def test_remove(self, customer_retrieve_mock, card_retrieve_mock, card_delete_mock):
        stripe_card = Card._api_create(customer=self.customer, source=FAKE_CARD["id"])
        Card.sync_from_stripe_data(stripe_card)

        self.assertEqual(1, self.customer.sources.count())

        card = self.customer.sources.all()[0]
        card.remove()

        self.assertEqual(0, self.customer.sources.count())
        self.assertTrue(card_delete_mock.called)
Ejemplo n.º 10
0
	def test_remove(self, customer_retrieve_mock, card_retrieve_mock, card_delete_mock):
		stripe_card = Card._api_create(customer=self.customer, source=FAKE_CARD["id"])
		Card.sync_from_stripe_data(stripe_card)

		self.assertEqual(1, self.customer.legacy_cards.count())

		card = self.customer.legacy_cards.all()[0]
		card.remove()

		self.assertEqual(0, self.customer.legacy_cards.count())
		self.assertTrue(card_delete_mock.called)
Ejemplo n.º 11
0
	def test_remove_unexpected_exception(self, customer_retrieve_mock, card_delete_mock):
		stripe_card = Card._api_create(customer=self.customer, source=FAKE_CARD["id"])
		Card.sync_from_stripe_data(stripe_card)

		card_delete_mock.side_effect = InvalidRequestError("Unexpected Exception", "blah")

		self.assertEqual(1, self.customer.legacy_cards.count())

		card = self.customer.legacy_cards.all()[0]

		with self.assertRaisesMessage(InvalidRequestError, "Unexpected Exception"):
			card.remove()
Ejemplo n.º 12
0
    def test_remove_unexpected_exception(self, customer_retrieve_mock, card_delete_mock):
        stripe_card = Card._api_create(customer=self.customer, source=FAKE_CARD["id"])
        Card.sync_from_stripe_data(stripe_card)

        card_delete_mock.side_effect = InvalidRequestError("Unexpected Exception", "blah")

        self.assertEqual(1, self.customer.sources.count())

        card = self.customer.sources.all()[0]

        with self.assertRaisesMessage(InvalidRequestError, "Unexpected Exception"):
            card.remove()
Ejemplo n.º 13
0
    def test_remove_no_such_customer(self, customer_retrieve_mock, card_delete_mock):
        stripe_card = Card._api_create(customer=self.customer, source=FAKE_CARD["id"])
        Card.sync_from_stripe_data(stripe_card)

        card_delete_mock.side_effect = InvalidRequestError("No such customer:", "blah")

        self.assertEqual(1, self.customer.sources.count())

        card = self.customer.sources.all()[0]
        card.remove()

        self.assertEqual(0, self.customer.sources.count())
        self.assertTrue(card_delete_mock.called)
Ejemplo n.º 14
0
	def test_remove_no_such_customer(self, customer_retrieve_mock, card_delete_mock):
		stripe_card = Card._api_create(customer=self.customer, source=FAKE_CARD["id"])
		Card.sync_from_stripe_data(stripe_card)

		card_delete_mock.side_effect = InvalidRequestError("No such customer:", "blah")

		self.assertEqual(1, self.customer.legacy_cards.count())

		card = self.customer.legacy_cards.all()[0]
		card.remove()

		self.assertEqual(0, self.customer.legacy_cards.count())
		self.assertTrue(card_delete_mock.called)
    def test_update_hire_service_not_exist_ko(self):
        final = self.final
        token_jwt_1 = jwt_encode(final)
        self.customer = FAKE_CUSTOMER.create_for_user(self.final)
        Card.sync_from_stripe_data(deepcopy(FAKE_CARD))

        data = {"credit_card": FAKE_CARD_II['id']}

        client = APIClient()
        response = client.patch(
            "/1.0/hire-services/0/",
            data=data,
            format='json',
            HTTP_AUTHORIZATION='Token {}'.format(token_jwt_1))
        self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
Ejemplo n.º 16
0
    def test_remove_already_deleted_card_by_account(self,
                                                    account_retrieve_mock,
                                                    card_delete_mock):

        stripe_card = Card._api_create(account=self.custom_account,
                                       source=FAKE_CARD_IV["id"])
        card = Card.sync_from_stripe_data(stripe_card)
        self.assertEqual(1, Card.objects.filter(id=stripe_card["id"]).count())

        # remove card
        card.remove()
        self.assertEqual(0, Card.objects.filter(id=stripe_card["id"]).count())

        # remove card again
        count, _ = Card.objects.filter(id=stripe_card["id"]).delete()
        self.assertEqual(0, count)

        api_key = card.default_api_key
        stripe_account = card._get_stripe_account_id(api_key)

        card_delete_mock.assert_called_once_with(
            self.custom_account.id,
            card.id,
            api_key=api_key,
            stripe_account=stripe_account,
        )
Ejemplo n.º 17
0
    def test_create_card_finds_account_with_customer_absent(self):
        # deepcopy the CardDict object
        FAKE_CARD_DICT = deepcopy(FAKE_CARD)
        # Add account and remove customer
        FAKE_CARD_DICT["account"] = self.standard_account.id
        FAKE_CARD_DICT["customer"] = None

        card = Card.sync_from_stripe_data(FAKE_CARD_DICT)

        self.assertEqual(self.standard_account, card.account)
        self.assertEqual(
            card.get_stripe_dashboard_url(),
            f"https://dashboard.stripe.com/{card.account.id}/settings/payouts",
        )

        self.assert_fks(
            card,
            expected_blank_fks={
                "djstripe.Card.customer",
                "djstripe.BankAccount.account",
                "djstripe.Customer.coupon",
                "djstripe.Customer.default_payment_method",
                "djstripe.Customer.default_source",
            },
        )
Ejemplo n.º 18
0
	def test_create_card_finds_customer(self):
		card = Card.sync_from_stripe_data(deepcopy(FAKE_CARD))

		self.assertEqual(self.customer, card.customer)
		self.assertEqual(
			card.get_stripe_dashboard_url(), self.customer.get_stripe_dashboard_url()
		)
Ejemplo n.º 19
0
    def test_create_card_finds_customer(self):
        card = Card.sync_from_stripe_data(deepcopy(FAKE_CARD))

        self.assertEqual(self.customer, card.customer)
        self.assertEqual(
            card.get_stripe_dashboard_url(), self.customer.get_stripe_dashboard_url()
        )
    def test_update_hire_service_final__ok(self):
        final = self.final
        token_jwt_1 = jwt_encode(final)
        self.customer = FAKE_CUSTOMER.create_for_user(self.final)
        Card.sync_from_stripe_data(deepcopy(FAKE_CARD))

        data = {"credit_card": FAKE_CARD['id']}

        client = APIClient()
        response = client.patch(
            "/1.0/hire-services/{0}/".format(self.hire_service_1.pk),
            data=data,
            format='json',
            HTTP_AUTHORIZATION='Token {}'.format(token_jwt_1))
        self.assertEqual(response.status_code, status.HTTP_200_OK)
        self.assertEqual(
            HireService.objects.get(pk=1).credit_card, FAKE_CARD['id'])
Ejemplo n.º 21
0
    def setUp(self):
        self.superuser = User.objects.get(pk=1)
        self.professional = User.objects.get(pk=3)
        self.final = User.objects.get(pk=4)
        self.professional_2 = User.objects.get(pk=5)

        self.hire_service_1 = HireService.objects.get(pk=1)
        self.hire_service_2 = HireService.objects.get(pk=2)
        self.hire_service_3 = HireService.objects.get(pk=3)
        self.hire_service_4 = HireService.objects.get(pk=4)

        # Add credit card to user_final
        self.customer = FAKE_CUSTOMER.create_for_user(self.final)
        Card.sync_from_stripe_data(deepcopy(FAKE_CARD))

        # Add credit card for hire service
        self.hire_service_2.credit_card = FAKE_CARD['id']
        self.hire_service_2.save()
    def test_update_hire_service_final_ko_credit_card_invalid(self):
        final = self.final
        token_jwt_1 = jwt_encode(final)
        self.customer = FAKE_CUSTOMER.create_for_user(self.final)
        Card.sync_from_stripe_data(deepcopy(FAKE_CARD))

        data = {"credit_card": "aaaaaaa"}

        client = APIClient()
        response = client.patch(
            "/1.0/hire-services/{0}/".format(self.hire_service_1.pk),
            data=data,
            format='json',
            HTTP_AUTHORIZATION='Token {}'.format(token_jwt_1))
        self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
        self.assertEqual(
            response.data.get('credit_card')[0],
            _("Credit card id is not included in app."))
    def test_update_hire_service_professional__ko(self):
        professional = self.professional
        token_jwt_1 = jwt_encode(professional)
        self.customer = FAKE_CUSTOMER.create_for_user(self.final)
        Card.sync_from_stripe_data(deepcopy(FAKE_CARD))

        data = {"credit_card": FAKE_CARD['id']}

        client = APIClient()
        response = client.patch(
            "/1.0/hire-services/{0}/".format(self.hire_service_1.pk),
            data=data,
            format='json',
            HTTP_AUTHORIZATION='Token {}'.format(token_jwt_1))
        self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
        self.assertEqual(
            response.data.get('non_field_errors')[0],
            _("Only client for the hire services can update credit card"))
Ejemplo n.º 24
0
    def test_str(self):
        fake_card = deepcopy(FAKE_CARD)
        card = Card.sync_from_stripe_data(fake_card)

        self.assertEqual(
            "<brand={brand}, last4={last4}, exp_month={exp_month}, exp_year={exp_year}, id={id}>"
            .format(brand=fake_card["brand"],
                    last4=fake_card["last4"],
                    exp_month=fake_card["exp_month"],
                    exp_year=fake_card["exp_year"],
                    id=fake_card["id"]), str(card))
Ejemplo n.º 25
0
    def test_api_retrieve_by_customer_equals_retrieval_by_account(
        self,
        customer_retrieve_source_mock,
        account_retrieve_external_account_mock,
        customer_retrieve_mock,
    ):
        # deepcopy the CardDict object
        FAKE_CARD_DICT = deepcopy(FAKE_CARD)

        card = Card.sync_from_stripe_data(deepcopy(FAKE_CARD_DICT))
        card_by_customer = card.api_retrieve()

        # Add account
        FAKE_CARD_DICT["account"] = FAKE_CUSTOM_ACCOUNT["id"]
        FAKE_CARD_DICT["customer"] = None

        card = Card.sync_from_stripe_data(FAKE_CARD_DICT)
        card_by_account = card.api_retrieve()

        # assert the same card object gets retrieved
        self.assertCountEqual(card_by_customer, card_by_account)
Ejemplo n.º 26
0
    def test_create_hire_service_ko_datetime_less_than_two_hours(self):
        superuser = User.objects.get(username='******')
        token_jwt_1 = jwt_encode(superuser)
        self.customer = FAKE_CUSTOMER.create_for_user(self.final)
        Card.sync_from_stripe_data(deepcopy(FAKE_CARD))

        self.customer_2 = FAKE_CUSTOMER_II.create_for_user(self.professional)
        Card.sync_from_stripe_data(deepcopy(FAKE_CARD_II))

        service_datetime = datetime.datetime.now()
        time = datetime.datetime.now() + datetime.timedelta(hours=1)

        data = {
            "client": self.final.pk,
            "professional": self.professional.pk,
            "date": service_datetime.strftime('%Y-%m-%d'),
            "time": time.strftime('%H:%M:%S'),
            "address": "Aligustre 20",
            "city": "Madrid",
            "region": "Madrid",
            "country": "Spain",
            "zip_code": "28039",
            "services": [self.service_1.pk, self.service_3.pk],
            "comments": "Hola",
            "total": 10.00,
            "credit_card": FAKE_CARD["id"]
        }

        client = APIClient()
        response = client.post(
            "/1.0/hire-services/",
            data=data,
            format='json',
            HTTP_AUTHORIZATION='Token {}'.format(token_jwt_1))
        self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
        self.assertEqual(
            response.data.get('non_field_errors')[0],
            _("The selected date is not enough to hire services."))
Ejemplo n.º 27
0
    def test_str(self):
        fake_card = deepcopy(FAKE_CARD)
        card = Card.sync_from_stripe_data(fake_card)

        self.assertEqual(
            "<brand={brand}, last4={last4}, exp_month={exp_month}, exp_year={exp_year}, stripe_id={stripe_id}>".format(
                brand=fake_card["brand"],
                last4=fake_card["last4"],
                exp_month=fake_card["exp_month"],
                exp_year=fake_card["exp_year"],
                stripe_id=fake_card["id"]
            ),
            str(card)
        )
Ejemplo n.º 28
0
    def test_create_card_finds_customer(self):
        card = Card.sync_from_stripe_data(deepcopy(FAKE_CARD))

        self.assertEqual(self.customer, card.customer)
        self.assertEqual(card.get_stripe_dashboard_url(),
                         self.customer.get_stripe_dashboard_url())

        self.assert_fks(
            card,
            expected_blank_fks={
                "djstripe.BankAccount.account",
                "djstripe.Customer.coupon",
                "djstripe.Customer.default_source",
            },
        )
Ejemplo n.º 29
0
	def test_str(self):
		fake_card = deepcopy(FAKE_CARD)
		card = Card.sync_from_stripe_data(fake_card)

		self.assertEqual(
			"<brand={brand}, last4={last4}, exp_month={exp_month}, exp_year={exp_year}, id={id}>".format(
				brand=fake_card["brand"],
				last4=fake_card["last4"],
				exp_month=fake_card["exp_month"],
				exp_year=fake_card["exp_year"],
				id=fake_card["id"],
			),
			str(card),
		)

		self.assert_fks(card, expected_blank_fks={"djstripe.Customer.coupon"})
Ejemplo n.º 30
0
	def test_str(self):
		fake_card = deepcopy(FAKE_CARD)
		card = Card.sync_from_stripe_data(fake_card)

		self.assertEqual(
			"<brand={brand}, last4={last4}, exp_month={exp_month}, exp_year={exp_year}, id={id}>".format(
				brand=fake_card["brand"],
				last4=fake_card["last4"],
				exp_month=fake_card["exp_month"],
				exp_year=fake_card["exp_year"],
				id=fake_card["id"],
			),
			str(card),
		)

		self.assert_fks(card, expected_blank_fks={"djstripe.Customer.coupon"})
Ejemplo n.º 31
0
    def test__str__(self, fake_stripe_data, has_account, has_customer,
                    monkeypatch):
        def mock_customer_get(*args, **kwargs):
            data = deepcopy(FAKE_CUSTOMER)
            data["default_source"] = None
            data["sources"] = []
            return data

        def mock_account_get(*args, **kwargs):
            return deepcopy(FAKE_CUSTOM_ACCOUNT)

        # monkeypatch stripe.Account.retrieve and stripe.Customer.retrieve calls to return
        # the desired json response.
        monkeypatch.setattr(stripe.Account, "retrieve", mock_account_get)
        monkeypatch.setattr(stripe.Customer, "retrieve", mock_customer_get)

        card = Card.sync_from_stripe_data(fake_stripe_data)
        default = False

        if has_account:
            account = Account.objects.filter(
                id=fake_stripe_data["account"]).first()

            default = fake_stripe_data["default_for_currency"]
            assert (
                f"{enums.CardBrand.humanize(fake_stripe_data['brand'])} {account.default_currency} {'Default' if default else ''} {fake_stripe_data['last4']}"
                == str(card))
        if has_customer:
            customer = Customer.objects.filter(
                id=fake_stripe_data["customer"]).first()

            default_source = customer.default_source
            default_payment_method = customer.default_payment_method

            if (default_payment_method
                    and fake_stripe_data["id"] == default_payment_method.id
                ) or (default_source
                      and fake_stripe_data["id"] == default_source.id):
                # current card is the default payment method or source
                default = True

            assert (
                f"{enums.CardBrand.humanize(fake_stripe_data['brand'])} {fake_stripe_data['last4']} {'Default' if default else ''} Expires {fake_stripe_data['exp_month']} {fake_stripe_data['exp_year']}"
                == str(card))
Ejemplo n.º 32
0
    def test_create_card_finds_customer_with_account_present(self):
        # deepcopy the CardDict object
        FAKE_CARD_DICT = deepcopy(FAKE_CARD)
        # Add account
        FAKE_CARD_DICT["account"] = self.standard_account.id

        card = Card.sync_from_stripe_data(FAKE_CARD_DICT)

        self.assertEqual(self.customer, card.customer)
        self.assertEqual(self.standard_account, card.account)
        self.assertEqual(
            card.get_stripe_dashboard_url(),
            self.customer.get_stripe_dashboard_url(),
        )

        self.assert_fks(
            card,
            expected_blank_fks={
                "djstripe.BankAccount.account",
                "djstripe.Customer.coupon",
                "djstripe.Customer.default_payment_method",
                "djstripe.Customer.default_source",
            },
        )
Ejemplo n.º 33
0
 def test_attach_objects_hook_without_customer(self):
     with self.assertRaisesMessage(ValidationError, "A customer was not attached to this card."):
         Card.sync_from_stripe_data(deepcopy(FAKE_CARD_III))
Ejemplo n.º 34
0
 def test_attach_objects_hook_without_customer(self):
     with self.assertRaisesMessage(ValidationError, "A customer was not attached to this card."):
         Card.sync_from_stripe_data(deepcopy(FAKE_CARD_III))
Ejemplo n.º 35
0
 def test_attach_objects_hook_without_customer(self):
     card = Card.sync_from_stripe_data(deepcopy(FAKE_CARD_III))
     self.assertEqual(card.customer, None)
Ejemplo n.º 36
0
    def test_attach_objects_hook_without_customer(self):
        FAKE_CARD_DICT = deepcopy(FAKE_CARD)
        FAKE_CARD_DICT["customer"] = None

        card = Card.sync_from_stripe_data(FAKE_CARD_DICT)
        self.assertEqual(card.customer, None)
Ejemplo n.º 37
0
 def test_attach_objects_hook_without_account(self):
     card = Card.sync_from_stripe_data(FAKE_CARD)
     self.assertEqual(card.account, None)
Ejemplo n.º 38
0
	def test_attach_objects_hook_without_customer(self):
		card = Card.sync_from_stripe_data(deepcopy(FAKE_CARD_III))
		self.assertEqual(card.customer, None)