'Testing whether an error 404 is returned when a playlist is removed from a channel without community'

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

    def mocked_get_community(_):
        raise CommunityNotFoundException('abcd')
    mock_dispersy = MockObject()
    mock_dispersy.get_community = mocked_get_community
    self.session.get_dispersy_instance = (lambda : mock_dispersy)
    channel_cid = 'fakedispersyid'.encode('hex')
    my_channel_id = self.create_my_channel('my    channel', 'this    is    a    short    description')
    self.create_playlist(my_channel_id, 1234, 42, 'test    playlist', 'test    description')
    return self.do_request(('channels/discovered/%s/playlists/1' % channel_cid), expected_code=404, request_type='DELETE')
