zulip/analytics/tests
Lauryn Menard dcae35196c remote-activity: Prefetch LicenseLedger entry for current plan.
To estimate the annual recurring revenue for remote server and
remote realm CustomerPlans, we prefetch the current license
ledger as part of the CustomerPlan query.

Also adds a select related to the remote realm audit log query
so that we don't go to the database for the remote realm ID.

With the test added in the previous commit, the query count for
the remote activity view goes from 27 to 11, as we are no longer
hitting the database multiple times for every current plan or
for every remote realm with audit log data.

Refactors get_customer_plan_renewal_amount so that a license
ledger is always passed and make_end_of_cycle_updates_if_needed
does not need to be called.
2024-01-25 15:35:44 -08:00
..
__init__.py
test_activity_views.py remote-activity: Prefetch LicenseLedger entry for current plan. 2024-01-25 15:35:44 -08:00
test_counts.py models: Extract zerver.models.scheduled_jobs. 2023-12-16 22:08:44 -08:00
test_fixtures.py tests: Consistently use assert_length helper. 2021-05-19 11:55:56 -07:00
test_stats_views.py models: Extract zerver.models.realms. 2023-12-16 22:08:44 -08:00
test_support_views.py support: Show date for start of next billing cycle for current plan. 2024-01-22 10:09:00 -08:00