1
0
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:
Adrian Holovaty
2011-03-28 02:11:19 +00:00
parent a87be3554f
commit 13864703bc
56 changed files with 113 additions and 326 deletions

View File

@@ -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)