def _generate_autopayable_entities(cls): """ Create account, domain and subscription linked to the autopay user that have autopay enabled """ cls.autopay_account = cls.account cls.autopay_account.created_by_domain = cls.domain cls.autopay_account.save() cls.autopay_user_email = generator.create_arbitrary_web_user_name() cls.fake_card = FakeStripeCard() cls.fake_stripe_customer = FakeStripeCustomer(cards=[cls.fake_card]) cls.autopay_account.update_autopay_user(cls.autopay_user_email, cls.domain)
def _generate_autopayable_entities(self): """ Create account, domain and subscription linked to the autopay user that have autopay enabled """ self.autopay_account = self.account self.autopay_account.created_by_domain = self.domain self.autopay_account.save() self.autopay_user = generator.arbitrary_web_user() self.fake_card = FakeStripeCard() self.fake_stripe_customer = FakeStripeCustomer(cards=[self.fake_card]) self.autopay_account.update_autopay_user(self.autopay_user.username, self.domain)
def setUp(self): super(TestStripePaymentMethod, self).setUp() self.web_user = generator.create_arbitrary_web_user_name() self.dimagi_user = generator.create_arbitrary_web_user_name(is_dimagi=True) self.fake_card = FakeStripeCard() self.fake_stripe_customer = FakeStripeCustomer(cards=[self.fake_card]) self.currency = generator.init_default_currency() self.billing_account = generator.billing_account(self.dimagi_user, self.web_user) self.billing_account_2 = generator.billing_account(self.dimagi_user, self.web_user) self.payment_method = StripePaymentMethod(web_user=self.web_user, customer_id=self.fake_stripe_customer.id) self.payment_method.save()