Files
zulip/zerver/tests/test_legacy_subject.py
Anders Kaseorg 6e4c3e41dc python: Normalize quotes with Black.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-12 13:11:19 -08:00

23 lines
706 B
Python

from zerver.lib.test_classes import ZulipTestCase
class LegacySubjectTest(ZulipTestCase):
def test_legacy_subject(self) -> None:
self.login("hamlet")
payload = dict(
type="stream",
to="Verona",
client="test suite",
content="Test message",
)
payload["subject"] = "whatever"
result = self.client_post("/json/messages", payload)
self.assert_json_success(result)
# You can't use both subject and topic.
payload["topic"] = "whatever"
result = self.client_post("/json/messages", payload)
self.assert_json_error(result, "Can't decide between 'topic' and 'subject' arguments")