refactor: Integrate POSTRequestMock into HostRequestMock.

Minimized code duplication by integrating POSTRequestMock into
HostRequestMock and then updating the required files with
HostRequestMock.

Fixes part of #1211.
This commit is contained in:
Rex Ferrer
2021-02-07 15:34:01 -05:00
committed by Tim Abbott
parent 4bbfac8aa9
commit d4c0578560
4 changed files with 36 additions and 43 deletions

View File

@@ -7,7 +7,7 @@ from django.http import HttpRequest, HttpResponse
from zerver.lib.actions import do_change_subscription_property, do_mute_topic
from zerver.lib.test_classes import ZulipTestCase
from zerver.lib.test_helpers import POSTRequestMock, mock_queue_publish
from zerver.lib.test_helpers import HostRequestMock, mock_queue_publish
from zerver.models import Recipient, Stream, Subscription, UserProfile, get_stream
from zerver.tornado.event_queue import (
ClientDescriptor,
@@ -288,7 +288,7 @@ class MissedMessageNotificationsTest(ZulipTestCase):
user_profile: UserProfile,
post_data: Dict[str, Any],
) -> HttpResponse:
request = POSTRequestMock(post_data, user_profile)
request = HostRequestMock(post_data, user_profile)
return view_func(request, user_profile)
def test_stream_watchers(self) -> None: