mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
sent_by_human: Add "test suite" to the set of Zulip UI-style clients.
Earlier, when we used 'self.send_message()' in the backend tests, the sent message was not marked as read for the sender. Reason: To set the read flag, we have to check if 'message.sent_by_human()'. It returns False because the 'sending_client' for tests is "test suite" and the 'sent_by_human' function doesn't enlist the "test suite" client name as a human client. This commit adds "test suite" to that list. Also fixes a bug in when apply_unread_message_event was called that was revealed by this change.
This commit is contained in:
committed by
Tim Abbott
parent
68abc6af21
commit
c349d1137c
@@ -3111,20 +3111,26 @@ class Message(AbstractMessage):
|
||||
sending_client = self.sending_client.name.lower()
|
||||
|
||||
return (
|
||||
sending_client
|
||||
in (
|
||||
"zulipandroid",
|
||||
"zulipios",
|
||||
"zulipdesktop",
|
||||
"zulipmobile",
|
||||
"zulipelectron",
|
||||
"zulipterminal",
|
||||
"snipe",
|
||||
"website",
|
||||
"ios",
|
||||
"android",
|
||||
(
|
||||
sending_client
|
||||
in (
|
||||
"zulipandroid",
|
||||
"zulipios",
|
||||
"zulipdesktop",
|
||||
"zulipmobile",
|
||||
"zulipelectron",
|
||||
"zulipterminal",
|
||||
"snipe",
|
||||
"website",
|
||||
"ios",
|
||||
"android",
|
||||
)
|
||||
)
|
||||
) or ("desktop app" in sending_client)
|
||||
or ("desktop app" in sending_client)
|
||||
# Since the vast majority of messages are sent by humans
|
||||
# in Zulip, treat test suite messages as such.
|
||||
or (sending_client == "test suite" and settings.TEST_SUITE)
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def is_status_message(content: str, rendered_content: str) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user