コード例 #1
0
def test_subscription_checkout(user_with_and_without_customer_id,
                               stripe_unsubscribed_price_id):
    session = payments.create_subscription_checkout(
        user_with_and_without_customer_id, stripe_unsubscribed_price_id)
    assert session["id"]
    assert session['setup_intent'] is None
    assert_signal_called(signals.checkout_created)
    assert_customer_id_exists(user_with_and_without_customer_id)
コード例 #2
0
ファイル: test_api.py プロジェクト: primal100/django_stripe
def test_billing_portal(authenticated_client_with_without_customer_id, user):
    response = make_request(authenticated_client_with_without_customer_id.post,
                            'billing',
                            201,
                            signal=signals.billing_portal_created)
    assert list(response.data.keys()) == ['url']
    assert "stripe.com" in response.data["url"]
    assert_customer_id_exists(user)
コード例 #3
0
ファイル: test_api.py プロジェクト: primal100/django_stripe
def test_setup_checkout(authenticated_client_with_without_customer_id, user, stripe_unsubscribed_price_id):
    response = make_request(authenticated_client_with_without_customer_id.post,
                            'setup-checkout',
                            201,
                            signal=signals.checkout_created)
    assert list(response.data.keys()) == ['id']
    assert response.data['id']
    assert_customer_id_exists(user)
コード例 #4
0
def test_billing_portal(user_with_and_without_customer_id):
    session = payments.create_billing_portal(user_with_and_without_customer_id)
    assert "stripe.com" in session["url"]
    assert_signal_called(signals.billing_portal_created)
    assert_customer_id_exists(user_with_and_without_customer_id)
コード例 #5
0
def test_setup_checkout(user_with_and_without_customer_id):
    session = payments.create_setup_checkout(user_with_and_without_customer_id)
    assert session["id"]
    assert session['setup_intent'] is not None
    assert_signal_called(signals.checkout_created)
    assert_customer_id_exists(user_with_and_without_customer_id)
コード例 #6
0
def test_create_customer(user_with_and_without_customer_id,
                         mock_customer_retrieve):
    payments.create_customer(user_with_and_without_customer_id)
    assert_customer_id_exists(user_with_and_without_customer_id)
    assert_signal_called(signals.new_customer)
    stripe.Customer.retrieve.assert_not_called()