'Check result of adding subscriptions.
You can add subscriptions for yourself or possibly many
principals, which is why e-mails map to subscriptions in the
result.
The result json is of the form
{"msg": "",
"result": "success",
"already_subscribed": {self.example_email("iago"): ["Venice", "Verona"]},
"subscribed": {self.example_email("iago"): ["Venice8"]}}'

def helper_check_subs_before_and_after_add(self, subscriptions, other_params, subscribed, already_subscribed, email, new_subs, realm, invite_only=False):

    result = self.common_subscribe_to_streams(self.test_email, subscriptions, other_params, invite_only=invite_only)
    self.assert_json_success(result)
    json = ujson.loads(result.content)
    self.assertEqual(sorted(subscribed), sorted(json['subscribed'][email]))
    self.assertEqual(sorted(already_subscribed), sorted(json['already_subscribed'][email]))
    new_streams = self.get_streams(email, realm)
    self.assertEqual(sorted(new_streams), sorted(new_subs))
