Use self.client_delete() wrapper in more places.

This commit is contained in:
Steve Howell 2016-07-27 19:51:08 -07:00 committed by Tim Abbott
parent 6937f63fd5
commit 985de51903
2 changed files with 6 additions and 6 deletions

View File

@ -166,7 +166,7 @@ class GCMTokenTests(AuthedTestCase):
result = self.client_post('/json/users/me/android_gcm_reg_id', {'token': token})
self.assert_json_success(result)
result = self.client.delete('/json/users/me/android_gcm_reg_id', urllib.parse.urlencode({'token': token}))
result = self.client_delete('/json/users/me/android_gcm_reg_id', {'token': token})
self.assert_json_success(result)
def test_change_user(self):

View File

@ -93,7 +93,7 @@ class StreamAdminTest(AuthedTestCase):
do_add_subscription(user_profile, stream, no_log=True)
do_change_is_admin(user_profile, True)
result = self.client.delete('/json/streams/new_stream')
result = self.client_delete('/json/streams/new_stream')
self.assert_json_success(result)
subscription_exists = Subscription.objects.filter(
user_profile=user_profile,
@ -112,7 +112,7 @@ class StreamAdminTest(AuthedTestCase):
stream, _ = create_stream_if_needed(realm, 'new_stream')
do_change_is_admin(user_profile, True)
result = self.client.delete('/json/streams/unknown_stream')
result = self.client_delete('/json/streams/unknown_stream')
self.assert_json_error(result, 'No such stream name')
def test_deactivate_stream_backend_requires_realm_admin(self):
@ -124,7 +124,7 @@ class StreamAdminTest(AuthedTestCase):
stream, _ = create_stream_if_needed(realm, 'new_stream')
do_add_subscription(user_profile, stream, no_log=True)
result = self.client.delete('/json/streams/new_stream')
result = self.client_delete('/json/streams/new_stream')
self.assert_json_error(result, 'Must be a realm administrator')
def test_rename_stream(self):
@ -252,7 +252,7 @@ class StreamAdminTest(AuthedTestCase):
events = [] # type: List[Dict[str, Any]]
with tornado_redirected_to_list(events):
result = self.client.delete('/json/streams/' + active_name)
result = self.client_delete('/json/streams/' + active_name)
self.assert_json_success(result)
deletion_events = [e['event'] for e in events if e['event']['type'] == 'subscription']
@ -324,7 +324,7 @@ class StreamAdminTest(AuthedTestCase):
priv_stream = self.set_up_stream_for_deletion(
"privstream", subscribed=False, invite_only=True)
result = self.client.delete('/json/streams/' + priv_stream.name)
result = self.client_delete('/json/streams/' + priv_stream.name)
self.assert_json_error(
result, "Cannot administer invite-only streams this way")