2020-06-11 00:54:34 +02:00
|
|
|
from zerver.lib.test_classes import ZulipTestCase
|
|
|
|
|
2018-11-09 19:45:25 +01:00
|
|
|
|
|
|
|
class LegacySubjectTest(ZulipTestCase):
|
|
|
|
def test_legacy_subject(self) -> None:
|
2020-03-06 18:40:46 +01:00
|
|
|
self.login('hamlet')
|
2018-11-09 19:45:25 +01:00
|
|
|
|
|
|
|
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")
|