'Calling subscribe on behalf of a principal in another realm
should return a JSON error.'

def test_subscription_add_principal_other_realm(self):

    profile = self.mit_user('starnine')
    principal = profile.email
    self.assertIsInstance(profile, UserProfile)
    result = self.common_subscribe_to_streams(self.test_email, self.streams, {'principals': ujson.dumps([principal])})
    self.assert_json_error(result, ("User    not    authorized    to    execute    queries    on    behalf    of    '%s'" % (principal,)), status_code=403)
