Fixes https://github.com/webrecorder/browsertrix/issues/1905 - adds a new top-level `/api/subscriptions` endpoint and SubOps handler on the backend. - enable subscriptions API endpoints available only if `billing_enabled` is set in helm chart - new POST /subscriptions/create, /subscriptions/update, /subscriptions/cancel API endpoints - Subscriptions mongo collection storing timestamped /subscription API events - GET /subscriptions/events API to get subscription events, support for filtering and sorting - Subscription data model - Support for setting and handling readOnlyOnCancel on org - /orgs/<id>/billing-portal to lookup portalUrl using external API - subscription in org getter and list views - mark org as readOnly for subscription status `paused_payment_failed`, clears it on status `active` --------- Co-authored-by: Tessa Walsh <tessa@bitarchivist.net>
22 lines
472 B
Python
22 lines
472 B
Python
import requests
|
|
|
|
from .conftest import API_PREFIX
|
|
|
|
|
|
def test_settings():
|
|
r = requests.get(f"{API_PREFIX}/settings")
|
|
assert r.status_code == 200
|
|
|
|
data = r.json()
|
|
|
|
assert data == {
|
|
"registrationEnabled": False,
|
|
"jwtTokenLifetime": 86400,
|
|
"defaultBehaviorTimeSeconds": 300,
|
|
"maxPagesPerCrawl": 4,
|
|
"maxScale": 3,
|
|
"defaultPageLoadTimeSeconds": 120,
|
|
"billingEnabled": True,
|
|
"salesEmail": "",
|
|
}
|