mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Removed a bunch more Python 2.4 workarounds now that we don't support that version. Refs #15702 -- thanks to jonash for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15927 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#! -*- coding: utf-8 -*-
|
||||
|
||||
import errno
|
||||
import hashlib
|
||||
import os
|
||||
import shutil
|
||||
from StringIO import StringIO
|
||||
@@ -10,7 +12,6 @@ from django.http.multipartparser import MultiPartParser
|
||||
from django.test import TestCase, client
|
||||
from django.utils import simplejson
|
||||
from django.utils import unittest
|
||||
from django.utils.hashcompat import sha_constructor
|
||||
|
||||
from models import FileModel, temp_storage, UPLOAD_TO
|
||||
import uploadhandler
|
||||
@@ -46,10 +47,10 @@ class FileUploadTests(TestCase):
|
||||
|
||||
for key in post_data.keys():
|
||||
try:
|
||||
post_data[key + '_hash'] = sha_constructor(post_data[key].read()).hexdigest()
|
||||
post_data[key + '_hash'] = hashlib.sha1(post_data[key].read()).hexdigest()
|
||||
post_data[key].seek(0)
|
||||
except AttributeError:
|
||||
post_data[key + '_hash'] = sha_constructor(post_data[key]).hexdigest()
|
||||
post_data[key + '_hash'] = hashlib.sha1(post_data[key]).hexdigest()
|
||||
|
||||
response = self.client.post('/file_uploads/verify/', post_data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user