Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
stripe: Remove unused do_change_remote_server_plan_type.
Lauryn Menard8f5b8dbf1a04
diff --git a/corporate/lib/stripe.py b/corporate/lib/stripe.pyindex cf8103a3579..087532449c3 100644--- a/corporate/lib/stripe.py+++ b/corporate/lib/stripe.py@@ -4746,19 +4746,6 @@ def ensure_customer_does_not_have_active_plan(customer: Customer) -> None:raise UpgradeWithExistingPlanError-def do_change_remote_server_plan_type(remote_server: RemoteZulipServer, plan_type: int) -> None:- old_value = remote_server.plan_type- remote_server.plan_type = plan_type- remote_server.save(update_fields=["plan_type"])- RemoteZulipServerAuditLog.objects.create(- event_type=RealmAuditLog.REMOTE_SERVER_PLAN_TYPE_CHANGED,- server=remote_server,- event_time=timezone_now(),- extra_data={"old_value": old_value, "new_value": plan_type},- )--@transaction.atomicdef do_reactivate_remote_server(remote_server: RemoteZulipServer) -> None:"""diff --git a/corporate/tests/test_stripe.py b/corporate/tests/test_stripe.pyindex 5f9a579a971..29d047418e2 100644--- a/corporate/tests/test_stripe.py+++ b/corporate/tests/test_stripe.py@@ -64,7 +64,6 @@ from corporate.lib.stripe import (compute_plan_parameters,customer_has_credit_card_as_default_payment_method,customer_has_last_n_invoices_open,- do_change_remote_server_plan_type,do_deactivate_remote_server,do_reactivate_remote_server,downgrade_small_realms_behind_on_payments_as_needed,@@ -4770,30 +4769,6 @@ class BillingHelpersTest(ZulipTestCase):plan.save(update_fields=["status"])self.assertTrue(is_realm_on_free_trial(realm))- def test_change_remote_server_plan_type(self) -> None:- server_uuid = str(uuid.uuid4())- remote_server = RemoteZulipServer.objects.create(- uuid=server_uuid,- api_key="magic_secret_api_key",- hostname="demo.example.com",- contact_email="[email protected]",- )- self.assertEqual(remote_server.plan_type, RemoteZulipServer.PLAN_TYPE_SELF_MANAGED)-- do_change_remote_server_plan_type(remote_server, RemoteZulipServer.PLAN_TYPE_BUSINESS)-- remote_server = RemoteZulipServer.objects.get(uuid=server_uuid)- remote_realm_audit_log = RemoteZulipServerAuditLog.objects.filter(- event_type=RealmAuditLog.REMOTE_SERVER_PLAN_TYPE_CHANGED- ).last()- assert remote_realm_audit_log is not None- expected_extra_data = {- "old_value": RemoteZulipServer.PLAN_TYPE_SELF_MANAGED,- "new_value": RemoteZulipServer.PLAN_TYPE_BUSINESS,- }- self.assertEqual(remote_realm_audit_log.extra_data, expected_extra_data)- self.assertEqual(remote_server.plan_type, RemoteZulipServer.PLAN_TYPE_BUSINESS)-def test_deactivate_reactivate_remote_server(self) -> None:server_uuid = str(uuid.uuid4())remote_server = RemoteZulipServer.objects.create(