summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2011-10-14 00:20:50 +0000
committerAlex Gaynor <alex.gaynor@gmail.com>2011-10-14 00:20:50 +0000
commit6c915219027ca5785db30767620680380ff9377d (patch)
tree40cde047a71c230793b338056c518a0f231f60ec
parentd1e74092785111fb514488646f7d213a964e1703 (diff)
Remove the usage of deprecated function in Django. Also simplify the fallback code.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16985 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/contrib/auth/forms.py1
-rw-r--r--django/utils/itercompat.py11
-rw-r--r--tests/regressiontests/admin_views/tests.py2
3 files changed, 4 insertions, 10 deletions
diff --git a/django/contrib/auth/forms.py b/django/contrib/auth/forms.py
index 9602d55736..b97c5d7054 100644
--- a/django/contrib/auth/forms.py
+++ b/django/contrib/auth/forms.py
@@ -1,7 +1,6 @@
from django import forms
from django.template import loader
from django.utils.http import int_to_base36
-from django.utils.itercompat import any
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
diff --git a/django/utils/itercompat.py b/django/utils/itercompat.py
index a56b703983..82434b7c9b 100644
--- a/django/utils/itercompat.py
+++ b/django/utils/itercompat.py
@@ -4,6 +4,7 @@ Where possible, we try to use the system-native version and only fall back to
these implementations if necessary.
"""
+import __builtin__
import itertools
import warnings
@@ -36,15 +37,9 @@ def is_iterable(x):
def all(iterable):
warnings.warn("django.utils.itercompat.all is deprecated; use the native version instead",
PendingDeprecationWarning)
- for item in iterable:
- if not item:
- return False
- return True
+ return __builtin__.all(iterable)
def any(iterable):
warnings.warn("django.utils.itercompat.any is deprecated; use the native version instead",
PendingDeprecationWarning)
- for item in iterable:
- if item:
- return True
- return False
+ return __builtin__.any(iterable)
diff --git a/tests/regressiontests/admin_views/tests.py b/tests/regressiontests/admin_views/tests.py
index 52664a0207..3e9b26d6fc 100644
--- a/tests/regressiontests/admin_views/tests.py
+++ b/tests/regressiontests/admin_views/tests.py
@@ -135,7 +135,7 @@ class AdminViewBasicTest(TestCase):
'date_1': u'14:55:39',
}
response = self.client.post('/test_admin/%s/admin_views/article/add/' % self.urlbit, post_data)
- self.failUnlessEqual(response.status_code, 200)
+ self.assertEqual(response.status_code, 200)
self.assertContains(response, 'dismissAddAnotherPopup')
self.assertContains(response, 'title with a new\u000Aline')