mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 07:23:22 +00:00
api/add-subscriptions: Test fixture for "already_subscribed".
In templates/zerver/api/add-subscriptions, we have a sample fixture for when the user being subscribed is already subscribed to a stream. This commit tests that fixture against a running server.
This commit is contained in:
@@ -47,6 +47,18 @@ def add_subscriptions(client):
|
||||
assert result['result'] == 'success'
|
||||
assert 'newbie@zulip.com' in result['subscribed']
|
||||
|
||||
def test_add_subscriptions_already_subscribed(client):
|
||||
# type: (Client) -> None
|
||||
result = client.add_subscriptions(
|
||||
streams=[
|
||||
{'name': 'new stream', 'description': 'New stream for testing'}
|
||||
],
|
||||
principals=['newbie@zulip.com']
|
||||
)
|
||||
|
||||
fixture = FIXTURES['add-subscriptions']['already_subscribed']
|
||||
test_against_fixture(result, fixture)
|
||||
|
||||
def create_user(client):
|
||||
# type: (Client) -> None
|
||||
|
||||
@@ -465,6 +477,7 @@ def test_streams(client):
|
||||
# type: (Client) -> None
|
||||
|
||||
add_subscriptions(client)
|
||||
test_add_subscriptions_already_subscribed(client)
|
||||
list_subscriptions(client)
|
||||
get_stream_id(client)
|
||||
get_streams(client)
|
||||
|
||||
Reference in New Issue
Block a user