'Test that video uploads throws error message when file name contains special characters.'

@override_settings(AWS_ACCESS_KEY_ID='test_key_id', AWS_SECRET_ACCESS_KEY='test_secret')
@patch('boto.s3.connection.S3Connection')
def test_upload_with_non_ascii_charaters(self, mock_conn):

    file_name = u'test\u2019_file.mp4'
    files = [{'file_name': file_name, 'content_type': 'video/mp4'}]
    bucket = Mock()
    mock_conn.return_value = Mock(get_bucket=Mock(return_value=bucket))
    response = self.client.post(self.url, json.dumps({'files': files}), content_type='application/json')
    self.assertEqual(response.status_code, 400)
    response = json.loads(response.content)
    self.assertEqual(response['error'], ('The    file    name    for    %s    must    contain    only    ASCII    characters.' % file_name))
