From 2e837b1407f4390a6d20f890a697420a8a48d889 Mon Sep 17 00:00:00 2001 From: Aditya Bansal Date: Thu, 12 Jul 2018 13:57:14 +0530 Subject: [PATCH] archives: Change the topic/ code path to use topics prefix. We do this for maintaining consistency in naming of the endpoints. --- zerver/tests/test_archive.py | 8 ++++---- zproject/urls.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/zerver/tests/test_archive.py b/zerver/tests/test_archive.py index 734c952d31..2bf06298f6 100644 --- a/zerver/tests/test_archive.py +++ b/zerver/tests/test_archive.py @@ -10,13 +10,13 @@ class GlobalPublicStreamTest(ZulipTestCase): def test_non_existant_stream_id(self) -> None: # Here we use a relatively big number as stream id assumming such an id # won't exist in the test DB. - result = self.client_get("/archive/streams/100000000/topic/TopicGlobal") + result = self.client_get("/archive/streams/100000000/topics/TopicGlobal") self.assert_in_success_response(["This stream does not exist."], result) def test_non_web_public_stream(self) -> None: test_stream = self.make_stream('Test Public Archives') result = self.client_get( - "/archive/streams/" + str(test_stream.id) + "/topic/notpublicglobalstream" + "/archive/streams/" + str(test_stream.id) + "/topics/notpublicglobalstream" ) self.assert_in_success_response(["This stream does not exist."], result) @@ -24,7 +24,7 @@ class GlobalPublicStreamTest(ZulipTestCase): test_stream = self.make_stream('Test Public Archives') do_change_stream_web_public(test_stream, True) result = self.client_get( - "/archive/streams/" + str(test_stream.id) + "/topic/nonexistenttopic" + "/archive/streams/" + str(test_stream.id) + "/topics/nonexistenttopic" ) self.assert_in_success_response(["This topic does not exist."], result) @@ -40,7 +40,7 @@ class GlobalPublicStreamTest(ZulipTestCase): 'TopicGlobal' ) return self.client_get( - "/archive/streams/" + str(test_stream.id) + "/topic/TopicGlobal" + "/archive/streams/" + str(test_stream.id) + "/topics/TopicGlobal" ) result = send_msg_and_get_result('Test Message 1') diff --git a/zproject/urls.py b/zproject/urls.py index a2dbbbdb17..88d6f338e9 100644 --- a/zproject/urls.py +++ b/zproject/urls.py @@ -457,7 +457,7 @@ i18n_urls = [ zerver.views.registration.create_realm, name='zerver.views.create_realm'), # Global public streams (Zulip's way of doing archives) - url(r'^archive/streams/(?P\d+)/topic/(?P[^/]+)$', + url(r'^archive/streams/(?P\d+)/topics/(?P[^/]+)$', zerver.views.archive.archive, name='zerver.views.archive.archive'), url(r'^archive/streams/(?P\d+)/topics$',