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,11 +1,11 @@
|
||||
import urllib
|
||||
from urlparse import urlparse, urlunparse, urlsplit
|
||||
import sys
|
||||
import os
|
||||
import re
|
||||
import mimetypes
|
||||
import warnings
|
||||
from copy import copy
|
||||
from urlparse import urlparse, urlunparse, urlsplit
|
||||
try:
|
||||
from cStringIO import StringIO
|
||||
except ImportError:
|
||||
|
||||
@@ -7,12 +7,6 @@ from django.test.utils import setup_test_environment, teardown_test_environment
|
||||
from django.test.testcases import OutputChecker, DocTestRunner, TestCase
|
||||
from django.utils import unittest
|
||||
|
||||
try:
|
||||
all
|
||||
except NameError:
|
||||
from django.utils.itercompat import all
|
||||
|
||||
|
||||
__all__ = ('DjangoTestRunner', 'DjangoTestSuiteRunner', 'run_tests')
|
||||
|
||||
# The module name for tests outside models.py
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import re
|
||||
import sys
|
||||
from functools import wraps
|
||||
from urlparse import urlsplit, urlunsplit
|
||||
from xml.dom.minidom import parseString, Node
|
||||
|
||||
@@ -16,21 +17,13 @@ from django.test.client import Client
|
||||
from django.test.utils import get_warnings_state, restore_warnings_state
|
||||
from django.utils import simplejson, unittest as ut2
|
||||
from django.utils.encoding import smart_str
|
||||
from django.utils.functional import wraps
|
||||
|
||||
__all__ = ('DocTestRunner', 'OutputChecker', 'TestCase', 'TransactionTestCase',
|
||||
'skipIfDBFeature', 'skipUnlessDBFeature')
|
||||
|
||||
|
||||
try:
|
||||
all
|
||||
except NameError:
|
||||
from django.utils.itercompat import all
|
||||
|
||||
normalize_long_ints = lambda s: re.sub(r'(?<![\w])(\d+)L(?![\w])', '\\1', s)
|
||||
normalize_decimals = lambda s: re.sub(r"Decimal\('(\d+(\.\d*)?)'\)", lambda m: "Decimal(\"%s\")" % m.groups()[0], s)
|
||||
|
||||
|
||||
def to_list(value):
|
||||
"""
|
||||
Puts value into a list if it's not already one.
|
||||
@@ -550,11 +543,9 @@ class TransactionTestCase(ut2.TestCase):
|
||||
|
||||
def connections_support_transactions():
|
||||
"""
|
||||
Returns True if all connections support transactions. This is messy
|
||||
because 2.4 doesn't support any or all.
|
||||
Returns True if all connections support transactions.
|
||||
"""
|
||||
return all(conn.features.supports_transactions
|
||||
for conn in connections.all())
|
||||
return all(conn.features.supports_transactions for conn in connections.all())
|
||||
|
||||
class TestCase(TransactionTestCase):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user