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

@@ -116,6 +116,10 @@ class AnalyticsTestCase(ZulipTestCase):
# used as defaults in self.assert_table_count
self.current_property: Optional[str] = None
# Delete RemoteRealm registrations to have a clean slate - the relevant
# tests want to construct this from scratch.
RemoteRealm.objects.all().delete()
# Lightweight creation of users, streams, and messages
def create_user(self, **kwargs: Any) -> UserProfile:
self.name_counter += 1