'Testing whether the API returns the right channel when subscribed to one channel'

@deferred(timeout=10)
def test_get_subscribed_channels_one_subscription(self):

    expected_json = {u'subscribed': [{u'description': u'This    is    a    description', u'id': (-1), u'dispersy_cid': unicode('rand'.encode('hex')), u'modified': int(time.time()), u'name': u'Test    Channel', u'spam': 0, u'subscribed': True, u'torrents': 0, u'votes': 0}]}
    cid = self.insert_channel_in_db('rand', 42, expected_json[u'subscribed'][0][u'name'], expected_json[u'subscribed'][0][u'description'])
    expected_json[u'subscribed'][0][u'id'] = cid
    self.vote_for_channel(cid, expected_json[u'subscribed'][0][u'modified'])
    return self.do_request('channels/subscribed', expected_code=200, expected_json=expected_json)
