Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
test_realm: Use assertLogs to avoid spam in test-backend output.
Mohit Gupta8b9deb9c71ce
diff --git a/zerver/tests/test_realm.py b/zerver/tests/test_realm.pyindex 3f5a63e0c5f..be017dae4d2 100644--- a/zerver/tests/test_realm.py+++ b/zerver/tests/test_realm.py@@ -44,9 +44,13 @@ class RealmTest(ZulipTestCase):def test_realm_creation_ensures_internal_realms(self) -> None:with mock.patch("zerver.lib.actions.server_initialized", return_value=False):- with mock.patch("zerver.lib.actions.create_internal_realm") as mock_create_internal:+ with mock.patch("zerver.lib.actions.create_internal_realm") as mock_create_internal, \+ self.assertLogs(level='INFO') as info_logs:do_create_realm("testrealm", "Test Realm")mock_create_internal.assert_called_once()+ self.assertEqual(info_logs.output, [+ 'INFO:root:Server not yet initialized. Creating the internal realm first.'+ ])def test_do_set_realm_name_caching(self) -> None:"""The main complicated thing about setting realm names is fighting the