tests: Create default RemoteRealms in populate_db.

This default setup will be more realistic, matching the ordinary
conditions for a modern server.
Especially needed as we add bouncer code that will expect to have
RemoteRealm entries for realm_uuid values for which it receives
requests.
This commit is contained in:
Mateusz Mandera
2023-12-01 18:06:22 +01:00
committed by Tim Abbott
parent a67dd6dc1f
commit c9b0602320
6 changed files with 30 additions and 7 deletions

View File

@@ -2385,14 +2385,13 @@ def get_topic_messages(user_profile: UserProfile, stream: Stream, topic_name: st
class BouncerTestCase(ZulipTestCase):
@override
def setUp(self) -> None:
# Set a deterministic uuid for convenience.
self.server_uuid = "6cde5f7a-1f7e-4978-9716-49f69ebfc9fe"
self.server = RemoteZulipServer(
uuid=self.server_uuid,
api_key="magic_secret_api_key",
hostname="demo.example.com",
last_updated=timezone_now(),
)
self.server = RemoteZulipServer.objects.all().latest("id")
self.server.uuid = self.server_uuid
self.server.save()
super().setUp()
@override