'A POST request to /api/v1/users/me/subscriptions/properties with stream_id and
color data sets the stream color, and for that stream only.'

def test_set_stream_color(self):

    test_user = self.example_user('hamlet')
    test_email = test_user.email
    test_realm = test_user.realm
    self.login(test_email)
    (old_subs, _) = gather_subscriptions(test_user)
    sub = old_subs[0]
    stream_id = sub['stream_id']
    new_color = '#ffffff'
    result = self.client_post('/api/v1/users/me/subscriptions/properties', {'subscription_data': ujson.dumps([{'property': 'color', 'stream_id': stream_id, 'value': '#ffffff'}])}, **self.api_auth(test_email))
    self.assert_json_success(result)
    new_subs = gather_subscriptions(get_user(test_email, test_realm))[0]
    found_sub = None
    for sub in new_subs:
        if (sub['stream_id'] == stream_id):
            found_sub = sub
            break
    assert (found_sub is not None)
    self.assertEqual(found_sub['color'], new_color)
    new_subs.remove(found_sub)
    for sub in old_subs:
        if (sub['stream_id'] == stream_id):
            found_sub = sub
            break
    old_subs.remove(found_sub)
    self.assertEqual(old_subs, new_subs)
