def test_user_from_customer_id(self, session):
        """Create a UserStripe interactor via Stripe Customer ID"""
        user = StripedUserFactory(tier="paid",
                                  stripe__payment_method="pm_card_visa")
        session.add(user)
        session.flush()

        uss = UserStripe.from_customer_id(user.stripe_id)

        assert uss.user == user
Ejemplo n.º 2
0
def user_async_unsubscribe(event: StripeObject):
    UserStripe.from_customer_id(
        event.data.object.customer
    ).unlink_from_plan_via_subscription(event.data.object.subscription)