tests: Reserve "Internal" client, used by email gateway and topic moves.

(cherry picked from commit 13b9c87f93)
This commit is contained in:
Alex Vandiver 2023-09-27 00:55:39 +00:00 committed by Tim Abbott
parent aee36b2b49
commit fd1db72276
6 changed files with 10 additions and 9 deletions

View File

@ -53,6 +53,7 @@ def create_internal_realm() -> None:
# just ensures these get low IDs in production, and in development
# avoids an extra database write for the first HTTP request in
# most tests.
get_client("Internal")
get_client("website")
get_client("ZulipMobile")
get_client("ZulipElectron")

View File

@ -1027,7 +1027,7 @@ class TestMissedMessageEmailMessages(ZulipTestCase):
incoming_valid_message["To"] = mm_address
incoming_valid_message["Reply-to"] = self.example_email("othello")
with self.assert_database_query_count(17):
with self.assert_database_query_count(16):
process_message(incoming_valid_message)
# confirm that Hamlet got the message
@ -1072,7 +1072,7 @@ class TestMissedMessageEmailMessages(ZulipTestCase):
incoming_valid_message["To"] = mm_address
incoming_valid_message["Reply-to"] = self.example_email("cordelia")
with self.assert_database_query_count(22):
with self.assert_database_query_count(21):
process_message(incoming_valid_message)
# Confirm Iago received the message.
@ -1124,7 +1124,7 @@ class TestMissedMessageEmailMessages(ZulipTestCase):
incoming_valid_message["To"] = mm_address
incoming_valid_message["Reply-to"] = user_profile.delivery_email
with self.assert_database_query_count(18):
with self.assert_database_query_count(17):
process_message(incoming_valid_message)
# confirm that Hamlet got the message

View File

@ -3785,7 +3785,7 @@ class EditMessageTest(EditMessageTestCase):
"iago", "test move stream", "new stream", "test"
)
with self.assert_database_query_count(56), self.assert_memcached_count(14):
with self.assert_database_query_count(55), self.assert_memcached_count(14):
result = self.client_patch(
f"/json/messages/{msg_id}",
{

View File

@ -931,7 +931,7 @@ class LoginTest(ZulipTestCase):
# seem to be any O(N) behavior. Some of the cache hits are related
# to sending messages, such as getting the welcome bot, looking up
# the alert words for a realm, etc.
with self.assert_database_query_count(105), self.assert_memcached_count(18):
with self.assert_database_query_count(104), self.assert_memcached_count(18):
with self.captureOnCommitCallbacks(execute=True):
self.register(self.nonreg_email("test"), "test")

View File

@ -4597,7 +4597,7 @@ class SubscriptionAPITest(ZulipTestCase):
realm = get_realm("zulip")
streams_to_sub = ["multi_user_stream"]
with self.capture_send_event_calls(expected_num_events=5) as events:
with self.assert_database_query_count(37):
with self.assert_database_query_count(36):
self.common_subscribe_to_streams(
self.test_user,
streams_to_sub,
@ -5522,7 +5522,7 @@ class SubscriptionAPITest(ZulipTestCase):
]
# Test creating a public stream when realm does not have a notification stream.
with self.assert_database_query_count(37):
with self.assert_database_query_count(36):
self.common_subscribe_to_streams(
self.test_user,
[new_streams[0]],
@ -6011,7 +6011,7 @@ class GetSubscribersTest(ZulipTestCase):
polonius.id,
]
with self.assert_database_query_count(47):
with self.assert_database_query_count(46):
self.common_subscribe_to_streams(
self.user_profile,
streams,

View File

@ -867,7 +867,7 @@ class QueryCountTest(ZulipTestCase):
prereg_user = PreregistrationUser.objects.get(email="fred@zulip.com")
with self.assert_database_query_count(94):
with self.assert_database_query_count(93):
with self.assert_memcached_count(23):
with self.capture_send_event_calls(expected_num_events=11) as events:
fred = do_create_user(