[svn] Use hashlib rather than depreciated sha

This commit is contained in:
pjrharley
2009-05-22 20:59:03 +01:00
parent 7fe5cd6ede
commit e27f5565cb
2 changed files with 17 additions and 10 deletions

View File

@@ -20,7 +20,7 @@ getting django-registration running in the default setup, to wit:
"""
import datetime
import sha
import hashlib
from django.conf import settings
from django.contrib.auth.models import User
@@ -115,7 +115,7 @@ class RegistrationModelTests(RegistrationTestCase):
self.failIf(RegistrationProfile.objects.activate_user('foo'))
# Activating from a key that doesn't exist returns False.
self.failIf(RegistrationProfile.objects.activate_user(sha.new('foo').hexdigest()))
self.failIf(RegistrationProfile.objects.activate_user(hashlib.sha1('foo').hexdigest()))
def test_account_expiration_condition(self):
"""
@@ -351,5 +351,5 @@ class RegistrationViewTests(RegistrationTestCase):
# Nonexistent key sets the account to False.
response = self.client.get(reverse('registration_activate',
kwargs={ 'activation_key': sha.new('foo').hexdigest() }))
kwargs={ 'activation_key': hashlib.sha1('foo').hexdigest() }))
self.failIf(response.context['account'])