mirror of
https://github.com/zulip/zulip.git
synced 2025-11-14 10:57:58 +00:00
test_subs: Fix syntax errors in tests.
This commit fixes the use of `/json/...` by replacing it with the correct `/api/v1/...`. Also removes unnecessary `login_user` call when using `api_patch`.
This commit is contained in:
committed by
Tim Abbott
parent
74bbd38ef7
commit
053f30aace
@@ -1419,7 +1419,6 @@ class StreamAdminTest(ZulipTestCase):
|
|||||||
desdemona = self.example_user("desdemona")
|
desdemona = self.example_user("desdemona")
|
||||||
iago = self.example_user("iago")
|
iago = self.example_user("iago")
|
||||||
|
|
||||||
self.login_user(desdemona)
|
|
||||||
stream = self.make_stream("test_stream", invite_only=False)
|
stream = self.make_stream("test_stream", invite_only=False)
|
||||||
self.subscribe(iago, stream.name)
|
self.subscribe(iago, stream.name)
|
||||||
|
|
||||||
@@ -1429,14 +1428,12 @@ class StreamAdminTest(ZulipTestCase):
|
|||||||
|
|
||||||
data = {}
|
data = {}
|
||||||
data["is_archived"] = "false"
|
data["is_archived"] = "false"
|
||||||
result = self.api_patch(desdemona, f"/json/streams/{stream.id}", info=data)
|
result = self.api_patch(desdemona, f"/api/v1/streams/{stream.id}", info=data)
|
||||||
self.assert_json_success(result)
|
self.assert_json_success(result)
|
||||||
stream.refresh_from_db()
|
stream.refresh_from_db()
|
||||||
self.assertFalse(stream.deactivated)
|
self.assertFalse(stream.deactivated)
|
||||||
|
|
||||||
cordelia = self.example_user("cordelia")
|
cordelia = self.example_user("cordelia")
|
||||||
self.login_user(cordelia)
|
|
||||||
|
|
||||||
stream1 = self.make_stream("test_stream_1", invite_only=False)
|
stream1 = self.make_stream("test_stream_1", invite_only=False)
|
||||||
self.subscribe(iago, stream1.name)
|
self.subscribe(iago, stream1.name)
|
||||||
|
|
||||||
@@ -1444,7 +1441,7 @@ class StreamAdminTest(ZulipTestCase):
|
|||||||
stream1.refresh_from_db()
|
stream1.refresh_from_db()
|
||||||
self.assertTrue(stream1.deactivated)
|
self.assertTrue(stream1.deactivated)
|
||||||
|
|
||||||
result = self.api_patch(cordelia, f"/json/streams/{stream1.id}", info=data)
|
result = self.api_patch(cordelia, f"/api/v1/streams/{stream1.id}", info=data)
|
||||||
self.assert_json_error(result, "You do not have permission to administer this channel.")
|
self.assert_json_error(result, "You do not have permission to administer this channel.")
|
||||||
|
|
||||||
do_change_stream_group_based_setting(
|
do_change_stream_group_based_setting(
|
||||||
@@ -1454,7 +1451,7 @@ class StreamAdminTest(ZulipTestCase):
|
|||||||
acting_user=desdemona,
|
acting_user=desdemona,
|
||||||
)
|
)
|
||||||
|
|
||||||
result = self.api_patch(cordelia, f"/json/streams/{stream1.id}", info=data)
|
result = self.api_patch(cordelia, f"/api/v1/streams/{stream1.id}", info=data)
|
||||||
self.assert_json_success(result)
|
self.assert_json_success(result)
|
||||||
|
|
||||||
stream1.refresh_from_db()
|
stream1.refresh_from_db()
|
||||||
|
|||||||
Reference in New Issue
Block a user