diff --git a/api/organisations/subscriptions/metadata.py b/api/organisations/subscriptions/metadata.py index fdb3033ab55d..fcec281c8c47 100644 --- a/api/organisations/subscriptions/metadata.py +++ b/api/organisations/subscriptions/metadata.py @@ -9,7 +9,7 @@ class BaseSubscriptionMetadata: def __init__( self, seats: int = 0, - api_calls: None | int = None, + api_calls: int = 0, projects: None | int = None, chargebee_email: None | str = None, audit_log_visibility_days: int | None = 0, diff --git a/api/tests/unit/organisations/subscriptions/test_unit_subscriptions_dataclasses.py b/api/tests/unit/organisations/subscriptions/test_unit_subscriptions_dataclasses.py index d8a4a1e5b629..d4a650878e8f 100644 --- a/api/tests/unit/organisations/subscriptions/test_unit_subscriptions_dataclasses.py +++ b/api/tests/unit/organisations/subscriptions/test_unit_subscriptions_dataclasses.py @@ -47,6 +47,11 @@ def test_base_subscription_metadata_add_raises_error_if_not_matching_payment_sou SourceASubscriptionMetadata(seats=1, api_calls=50000, projects=1), SourceASubscriptionMetadata(seats=2, api_calls=100000, projects=None), ), + ( + SourceASubscriptionMetadata(seats=1, api_calls=50000), + SourceASubscriptionMetadata(seats=1), + SourceASubscriptionMetadata(seats=2, api_calls=50000), + ), ), ) def test_base_subscription_metadata_add(add_to, add, expected_result):