push_notifications: Enforce max user count on self managed plan.

We do not support sending push notifications for realms having
more than 10 users on self managed plan.
This commit is contained in:
Sahil Batra
2023-12-12 21:45:57 +05:30
committed by Tim Abbott
parent 10862451ef
commit 03323b0124
4 changed files with 304 additions and 24 deletions

View File

@@ -1459,8 +1459,9 @@ class TestLoggingCountStats(AnalyticsTestCase):
now = timezone_now()
with time_machine.travel(now, tick=False), mock.patch(
"zilencer.views.send_android_push_notification", return_value=1
), mock.patch(
"zilencer.views.send_apple_push_notification", return_value=1
), mock.patch("zilencer.views.send_apple_push_notification", return_value=1), mock.patch(
"corporate.lib.stripe.RemoteServerBillingSession.current_count_for_billed_licenses",
return_value=10,
), self.assertLogs(
"zilencer.views", level="INFO"
):
@@ -1519,8 +1520,9 @@ class TestLoggingCountStats(AnalyticsTestCase):
}
with time_machine.travel(now, tick=False), mock.patch(
"zilencer.views.send_android_push_notification", return_value=1
), mock.patch(
"zilencer.views.send_apple_push_notification", return_value=1
), mock.patch("zilencer.views.send_apple_push_notification", return_value=1), mock.patch(
"corporate.lib.stripe.RemoteServerBillingSession.current_count_for_billed_licenses",
return_value=10,
), self.assertLogs(
"zilencer.views", level="INFO"
):
@@ -1578,8 +1580,9 @@ class TestLoggingCountStats(AnalyticsTestCase):
with time_machine.travel(now, tick=False), mock.patch(
"zilencer.views.send_android_push_notification", return_value=1
), mock.patch(
"zilencer.views.send_apple_push_notification", return_value=1
), mock.patch("zilencer.views.send_apple_push_notification", return_value=1), mock.patch(
"corporate.lib.stripe.RemoteServerBillingSession.current_count_for_billed_licenses",
return_value=10,
), self.assertLogs(
"zilencer.views", level="INFO"
):