Commit 6c915219 authored by Alex Gaynor's avatar Alex Gaynor
Browse files

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
parent d1e74092
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
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
+3 −8
Original line number Diff line number Diff line
@@ -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)
+1 −1
Original line number Diff line number Diff line
@@ -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')