Allow message topic changing to propagate backwards

(imported from commit 470178ef5f7aaf09d4528c88ae6e33f17538fcaf)
This commit is contained in:
Leo Franchi
2013-09-13 12:12:29 -04:00
parent c417f3323d
commit c588c7938c
6 changed files with 67 additions and 19 deletions

View File

@@ -1542,7 +1542,7 @@ class EditMessageTest(AuthedTestCase):
self.assert_json_success(result)
self.check_message(msg_id, subject="edited")
def test_propagate_topic(self):
def test_propagate_topic_forward(self):
self.login("hamlet@zulip.com")
id1 = self.send_message("hamlet@zulip.com", "Scotland", Recipient.STREAM,
subject="topic1")
@@ -1558,7 +1558,7 @@ class EditMessageTest(AuthedTestCase):
result = self.client.post("/json/update_message", {
'message_id': id1,
'subject': 'edited',
'propagate_subject': True
'propagate_mode': 'change_later'
})
self.assert_json_success(result)
@@ -1568,6 +1568,35 @@ class EditMessageTest(AuthedTestCase):
self.check_message(id4, subject="topic2")
self.check_message(id5, subject="edited")
def test_propagate_all_topics(self):
self.login("hamlet@zulip.com")
id1 = self.send_message("hamlet@zulip.com", "Scotland", Recipient.STREAM,
subject="topic1")
id2 = self.send_message("hamlet@zulip.com", "Scotland", Recipient.STREAM,
subject="topic1")
id3 = self.send_message("iago@zulip.com", "Rome", Recipient.STREAM,
subject="topic1")
id4 = self.send_message("hamlet@zulip.com", "Scotland", Recipient.STREAM,
subject="topic2")
id5 = self.send_message("iago@zulip.com", "Scotland", Recipient.STREAM,
subject="topic1")
id6 = self.send_message("iago@zulip.com", "Scotland", Recipient.STREAM,
subject="topic3")
result = self.client.post("/json/update_message", {
'message_id': id2,
'subject': 'edited',
'propagate_mode': 'change_all'
})
self.assert_json_success(result)
self.check_message(id1, subject="edited")
self.check_message(id2, subject="edited")
self.check_message(id3, subject="topic1")
self.check_message(id4, subject="topic2")
self.check_message(id5, subject="edited")
self.check_message(id6, subject="topic3")
class InviteUserTest(AuthedTestCase):
def invite(self, users, streams):