test_stripe: Rename 'realm_user_count' to 'server_user_count'.

This commit renames the variable 'realm_user_count' to
'server_user_count' in 'test_upgrade_user_to_monthly_basic_plan'.

The variable was incorrectly named earlier as it stores
the user count of the whole server.
This commit is contained in:
Prakhar Pratyush 2024-01-10 13:39:11 +05:30 committed by Tim Abbott
parent 79ec61b373
commit 4c47b9ef2b
1 changed files with 5 additions and 5 deletions

View File

@ -6868,8 +6868,8 @@ class TestRemoteServerBillingFlow(StripeTestCase, RemoteServerTestCase):
hamlet = self.example_user("hamlet") hamlet = self.example_user("hamlet")
self.add_mock_response() self.add_mock_response()
realm_user_count = UserProfile.objects.filter(is_bot=False, is_active=True).count() server_user_count = UserProfile.objects.filter(is_bot=False, is_active=True).count()
self.assertEqual(realm_user_count, 18) self.assertEqual(server_user_count, 18)
with time_machine.travel(self.now, tick=False): with time_machine.travel(self.now, tick=False):
send_server_data_to_push_bouncer(consider_usage_statistics=False) send_server_data_to_push_bouncer(consider_usage_statistics=False)
@ -6919,10 +6919,10 @@ class TestRemoteServerBillingFlow(StripeTestCase, RemoteServerTestCase):
for substring in [ for substring in [
"Zulip Basic", "Zulip Basic",
"Number of licenses", "Number of licenses",
f"{realm_user_count} (managed automatically)", f"{server_user_count} (managed automatically)",
"February 2, 2012", "February 2, 2012",
"Your plan will automatically renew on", "Your plan will automatically renew on",
f"${3.5 * realm_user_count - flat_discount // 100 * 1:,.2f}", f"${3.5 * server_user_count - flat_discount // 100 * 1:,.2f}",
"Visa ending in 4242", "Visa ending in 4242",
"Update card", "Update card",
]: ]:
@ -6933,7 +6933,7 @@ class TestRemoteServerBillingFlow(StripeTestCase, RemoteServerTestCase):
self.assertEqual(LicenseLedger.objects.count(), 1) self.assertEqual(LicenseLedger.objects.count(), 1)
with time_machine.travel(self.now + timedelta(days=2), tick=False): with time_machine.travel(self.now + timedelta(days=2), tick=False):
for count in range(realm_user_count, realm_user_count + 10): for count in range(server_user_count, server_user_count + 10):
do_create_user( do_create_user(
f"email {count}", f"email {count}",
f"password {count}", f"password {count}",