test_remote_billing: Extract remote server / realm login methods.

This commit is contained in:
Aman Agrawal 2023-12-15 13:08:32 +00:00 committed by Tim Abbott
parent 1f7b3d7a2d
commit 53b7e956ea
1 changed files with 7 additions and 3 deletions

View File

@ -40,8 +40,7 @@ if TYPE_CHECKING:
from django.test.client import _MonkeyPatchedWSGIResponse as TestHttpResponse
@override_settings(PUSH_NOTIFICATION_BOUNCER_URL="https://push.zulip.org.example.com")
class RemoteBillingAuthenticationTest(BouncerTestCase):
class RemoteRealmBillingTestCase(BouncerTestCase):
def execute_remote_billing_authentication_flow(
self,
user: UserProfile,
@ -169,6 +168,9 @@ class RemoteBillingAuthenticationTest(BouncerTestCase):
# depending on the set up and intent of the test.
return result
@override_settings(PUSH_NOTIFICATION_BOUNCER_URL="https://push.zulip.org.example.com")
class RemoteBillingAuthenticationTest(RemoteRealmBillingTestCase):
@responses.activate
def test_remote_billing_authentication_flow(self) -> None:
self.login("desdemona")
@ -756,7 +758,7 @@ class RemoteBillingAuthenticationTest(BouncerTestCase):
self.assertEqual(server_plan.status, CustomerPlan.ACTIVE)
class LegacyServerLoginTest(BouncerTestCase):
class RemoteServerTestCase(BouncerTestCase):
@override
def setUp(self) -> None:
super().setUp()
@ -870,6 +872,8 @@ class LegacyServerLoginTest(BouncerTestCase):
return result
class LegacyServerLoginTest(RemoteServerTestCase):
def test_server_login_get(self) -> None:
result = self.client_get("/serverlogin/", subdomain="selfhosting")
self.assertEqual(result.status_code, 200)