mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 21:13:36 +00:00
models: Rename tiers to pass stripe 22 character limit.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user