def test_api_reject(
    fileupload_retrieve_mock,
    account_reject_mock,
    account_retrieve_mock,
    extra_kwargs,
    api_key,
    expected_api_key,
    stripe_account,
    monkeypatch,
):
    """Test that API reject properly uses the passed in parameters."""

    def mock_account_retrieve(*args, **kwargs):
        return FAKE_PLATFORM_ACCOUNT

    monkeypatch.setattr(stripe.Account, "retrieve", mock_account_retrieve)

    # create a Stripe Platform Account
    FAKE_PLATFORM_ACCOUNT.create()

    fake_account = deepcopy(FAKE_ACCOUNT)
    fake_account_rejected = deepcopy(FAKE_ACCOUNT)
    fake_account_rejected["charges_enabled"] = False
    fake_account_rejected["payouts_enabled"] = False
    account_reject_mock.return_value = fake_account_rejected

    account = Account.sync_from_stripe_data(fake_account)

    # invoke api_reject()
    account_rejected = account.api_reject(
        api_key=api_key, stripe_account=stripe_account, **extra_kwargs
    )

    assert account_rejected["charges_enabled"] is False
    assert account_rejected["payouts_enabled"] is False

    Account.stripe_class.reject.assert_called_once_with(
        account.id,
        api_key=expected_api_key,
        stripe_account=stripe_account or FAKE_PLATFORM_ACCOUNT["id"],
        stripe_version=djstripe_settings.STRIPE_API_VERSION,
        **extra_kwargs,
    )
Test that API reject properly uses the passed in parameters.
tests/test_account.py