'The storage backend shouldn\'t mess with the case of the filenames
uploaded.'

def test_filename_case_preservation(self):

    vars = {u'boundary': u'oUrBoUnDaRyStRiNg'}
    post_data = [u'--%(boundary)s', u'Content-Disposition:    form-data;    name="file_field";    filename="MiXeD_cAsE.txt"', u'Content-Type:    application/octet-stream', u'', u'file    contents\n', u'--%(boundary)s--\r\n']
    response = self.client.post(u'/file_uploads/filename_case/', (u'\r\n'.join(post_data) % vars), (u'multipart/form-data;    boundary=%(boundary)s' % vars))
    self.assertEqual(response.status_code, 200)
    id = int(response.content)
    obj = FileModel.objects.get(pk=id)
    self.assertEqual(os.path.basename(obj.testfile.path), u'MiXeD_cAsE.txt')
