Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

models: Rename tiers to pass stripe 22 character limit.

Aman Agrawal36532e918060
diff --git a/corporate/models.py b/corporate/models.py
index cf8a08dbd21..33858a096dc 100644
--- a/corporate/models.py
+++ b/corporate/models.py
@@ -289,11 +289,14 @@ class CustomerPlan(models.Model):
@staticmethod
def name_from_tier(tier: int) -> str:
+ # NOTE: Check `statement_descriptor` values after updating this.
+ # Stripe has a 22 character limit on the statement descriptor length.
+ # https://stripe.com/docs/payments/account/statement-descriptors
return {
CustomerPlan.TIER_CLOUD_STANDARD: "Zulip Cloud Standard",
- CustomerPlan.TIER_CLOUD_PLUS: "Zulip Plus",
+ CustomerPlan.TIER_CLOUD_PLUS: "Zulip Cloud Plus",
CustomerPlan.TIER_CLOUD_ENTERPRISE: "Zulip Enterprise",
- CustomerPlan.TIER_SELF_HOSTED_BUSINESS: "Zulip Self-Hosted Business",
+ CustomerPlan.TIER_SELF_HOSTED_BUSINESS: "Zulip Business",
}[tier]
@property
diff --git a/corporate/tests/test_remote_billing.py b/corporate/tests/test_remote_billing.py
index d24f425d435..a8bdaa49a2b 100644
--- a/corporate/tests/test_remote_billing.py
+++ b/corporate/tests/test_remote_billing.py
@@ -348,7 +348,7 @@ class LegacyServerLoginTest(BouncerTestCase):
# Access on the upgrade page is granted, assert a basic string proving that.
result = self.client_get(result["Location"], subdomain="selfhosting")
self.assert_in_success_response(
- [f"Upgrade {self.server.hostname} to Zulip Self-Hosted Business"], result
+ [f"Upgrade {self.server.hostname} to Zulip Business"], result
)
def test_server_login_success_with_next_page(self) -> None:
@@ -427,7 +427,7 @@ class LegacyServerLoginTest(BouncerTestCase):
# Sanity check: access on the upgrade page is granted.
result = self.client_get(result["Location"], subdomain="selfhosting")
self.assert_in_success_response(
- [f"Upgrade {self.server.hostname} to Zulip Self-Hosted Business"], result
+ [f"Upgrade {self.server.hostname} to Zulip Business"], result
)
# Now we can simulate an expired identity dict in the session.
diff --git a/corporate/tests/test_stripe.py b/corporate/tests/test_stripe.py
index 9dde56482dd..6da41291ae7 100644
--- a/corporate/tests/test_stripe.py
+++ b/corporate/tests/test_stripe.py
@@ -5300,7 +5300,7 @@ class TestSupportBillingHelpers(StripeTestCase):
new_plan_tier=CustomerPlan.TIER_CLOUD_PLUS,
)
success_message = billing_session.process_support_view_request(support_request)
- self.assertEqual(success_message, "zulip upgraded to Zulip Plus")
+ self.assertEqual(success_message, "zulip upgraded to Zulip Cloud Plus")
customer.refresh_from_db()
new_plan = get_current_plan_by_customer(customer)
assert new_plan is not None