mirror of https://github.com/zulip/zulip.git
test_subs: Explicitly declare subdomains.
This commit is contained in:
parent
6caca80ab7
commit
edc095db6d
|
@ -499,12 +499,14 @@ class ZulipTestCase(TestCase):
|
||||||
bulk_remove_subscriptions([user_profile], [stream])
|
bulk_remove_subscriptions([user_profile], [stream])
|
||||||
|
|
||||||
# Subscribe to a stream by making an API request
|
# Subscribe to a stream by making an API request
|
||||||
def common_subscribe_to_streams(self, email, streams, extra_post_data={}, invite_only=False):
|
def common_subscribe_to_streams(self, email, streams, extra_post_data={}, invite_only=False,
|
||||||
# type: (Text, Iterable[Text], Dict[str, Any], bool) -> HttpResponse
|
**kwargs):
|
||||||
|
# type: (Text, Iterable[Text], Dict[str, Any], bool, **Any) -> HttpResponse
|
||||||
post_data = {'subscriptions': ujson.dumps([{"name": stream} for stream in streams]),
|
post_data = {'subscriptions': ujson.dumps([{"name": stream} for stream in streams]),
|
||||||
'invite_only': ujson.dumps(invite_only)}
|
'invite_only': ujson.dumps(invite_only)}
|
||||||
post_data.update(extra_post_data)
|
post_data.update(extra_post_data)
|
||||||
result = self.client_post("/api/v1/users/me/subscriptions", post_data, **self.api_auth(email))
|
result = self.client_post("/api/v1/users/me/subscriptions", post_data,
|
||||||
|
**self.api_auth(email), **kwargs)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def send_json_payload(self, user_profile, url, payload, stream_name=None, **post_params):
|
def send_json_payload(self, user_profile, url, payload, stream_name=None, **post_params):
|
||||||
|
|
|
@ -1458,6 +1458,7 @@ class SubscriptionAPITest(ZulipTestCase):
|
||||||
extra_post_data=dict(
|
extra_post_data=dict(
|
||||||
announce='true'
|
announce='true'
|
||||||
),
|
),
|
||||||
|
subdomain="testrealm",
|
||||||
)
|
)
|
||||||
self.assert_json_success(result)
|
self.assert_json_success(result)
|
||||||
|
|
||||||
|
@ -1836,6 +1837,7 @@ class SubscriptionAPITest(ZulipTestCase):
|
||||||
self.mit_email("starnine"),
|
self.mit_email("starnine"),
|
||||||
streams,
|
streams,
|
||||||
dict(principals=ujson.dumps([self.mit_email("starnine")])),
|
dict(principals=ujson.dumps([self.mit_email("starnine")])),
|
||||||
|
subdomain="zephyr",
|
||||||
)
|
)
|
||||||
# Make sure Zephyr mirroring realms such as MIT do not get
|
# Make sure Zephyr mirroring realms such as MIT do not get
|
||||||
# any tornado subscription events
|
# any tornado subscription events
|
||||||
|
@ -2486,7 +2488,8 @@ class GetSubscribersTest(ZulipTestCase):
|
||||||
email,
|
email,
|
||||||
["mit_invite_only"],
|
["mit_invite_only"],
|
||||||
dict(principals=ujson.dumps(users_to_subscribe)),
|
dict(principals=ujson.dumps(users_to_subscribe)),
|
||||||
invite_only=True)
|
invite_only=True,
|
||||||
|
subdomain="zephyr")
|
||||||
self.assert_json_success(ret)
|
self.assert_json_success(ret)
|
||||||
|
|
||||||
with queries_captured() as queries:
|
with queries_captured() as queries:
|
||||||
|
@ -2644,6 +2647,6 @@ class AccessStreamTest(ZulipTestCase):
|
||||||
access_stream_by_name(sipbtest, mit_stream.name)
|
access_stream_by_name(sipbtest, mit_stream.name)
|
||||||
|
|
||||||
# But they can access streams they are subscribed to
|
# But they can access streams they are subscribed to
|
||||||
self.common_subscribe_to_streams(sipbtest.email, [mit_stream.name])
|
self.common_subscribe_to_streams(sipbtest.email, [mit_stream.name], subdomain="zephyr")
|
||||||
access_stream_by_id(sipbtest, mit_stream.id)
|
access_stream_by_id(sipbtest, mit_stream.id)
|
||||||
access_stream_by_name(sipbtest, mit_stream.name)
|
access_stream_by_name(sipbtest, mit_stream.name)
|
||||||
|
|
Loading…
Reference in New Issue