'Testing whether an error 404 is returned when a torrent is added to a non-existing playlist'

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

    mock_channel_community = MockObject()
    mock_channel_community.called_add = False
    self.create_fake_channel('channel', '')
    mock_dispersy = MockObject()
    mock_dispersy.get_community = (lambda _: mock_channel_community)
    self.session.get_dispersy_instance = (lambda : mock_dispersy)
    channel_cid = 'fakedispersyid'.encode('hex')
    self.create_my_channel('my    channel', 'this    is    a    short    description')
    return self.do_request(('channels/discovered/%s/playlists/1/abcd' % channel_cid), expected_code=404, request_type='PUT')
