'Testing whether the API returns error 400 if an unknown state is passed when modifying a download'

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

    (video_tdef, _) = self.create_local_torrent(os.path.join(TESTS_DATA_DIR, 'video.avi'))
    self.session.start_download_from_tdef(video_tdef, DownloadStartupConfig())
    self.should_check_equality = False
    return self.do_request(('downloads/%s' % video_tdef.get_infohash().encode('hex')), expected_code=400, post_data={'state': 'abc'}, request_type='PATCH')
