Skip to content

[ING-30] test: Cover currency filter on list endpoints#397

Draft
aquinofb wants to merge 1 commit into
mainfrom
feat/ing-30-currency-filter
Draft

[ING-30] test: Cover currency filter on list endpoints#397
aquinofb wants to merge 1 commit into
mainfrom
feat/ing-30-currency-filter

Conversation

@aquinofb
Copy link
Copy Markdown

Context

The lago-api backend exposes an optional currency query parameter on the subscriptions, wallets, and payment_requests list endpoints (getlago/lago-api#5249). The Python client's find_all(options) already forwards arbitrary options as query parameters, so no source change is required, but the behavior was untested.

Description

Adds a find_all test with {"currency": "EUR"} to the subscription, wallet, and payment_request client tests. Each registers an httpx mock keyed on the currency query string, so the test fails (pytest-httpx flags the unmatched request) if the option is not forwarded.

How to try locally

python -m venv .venv && . .venv/bin/activate
pip install ".[test]"
python -m pytest tests/test_subscription_client.py tests/test_wallet_client.py tests/test_payment_request_client.py

## Context

The lago-api backend exposes a `currency` query parameter on the
subscriptions, wallets, and payment_requests list endpoints (PR #5249).
The Python client forwards arbitrary options as query params via
find_all, so no source change is needed, but the behavior was untested.

## Description

Add a find_all forwarding test for the `currency` option to the
subscription, wallet, and payment_request client tests. Each stubs the
request with the currency query string, so the test fails if the option
is not forwarded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant