diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-07-01 14:22:27 +0200 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-07-01 14:29:33 +0200 |
| commit | cfcf4b3605f9653e4e056088d89932b2a0e4281b (patch) | |
| tree | 1eed1ebdb087b26abeddf5245fc723930d14d847 /django/test | |
| parent | 7f264e02f4480c49d1440be882416a10951c2165 (diff) | |
Stopped using django.utils.unittest in the test suite.
Refs #20680.
Diffstat (limited to 'django/test')
| -rw-r--r-- | django/test/runner.py | 4 | ||||
| -rw-r--r-- | django/test/testcases.py | 17 |
2 files changed, 11 insertions, 10 deletions
diff --git a/django/test/runner.py b/django/test/runner.py index e753e365fa..709b685de5 100644 --- a/django/test/runner.py +++ b/django/test/runner.py @@ -1,12 +1,12 @@ import os from optparse import make_option +import unittest +from unittest import TestSuite, defaultTestLoader from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.test import TestCase from django.test.utils import setup_test_environment, teardown_test_environment -from django.utils import unittest -from django.utils.unittest import TestSuite, defaultTestLoader class DiscoverRunner(object): diff --git a/django/test/testcases.py b/django/test/testcases.py index 53b15158ca..c5299bdabc 100644 --- a/django/test/testcases.py +++ b/django/test/testcases.py @@ -8,13 +8,16 @@ import json import os import re import sys +import select +import socket +import threading +import unittest +from unittest import skipIf # Imported here for backward compatibility +from unittest.util import safe_repr try: from urllib.parse import urlsplit, urlunsplit except ImportError: # Python 2 from urlparse import urlsplit, urlunsplit -import select -import socket -import threading from django.conf import settings from django.contrib.staticfiles.handlers import StaticFilesHandler @@ -36,10 +39,8 @@ from django.test.html import HTMLParseError, parse_html from django.test.signals import template_rendered from django.test.utils import (CaptureQueriesContext, ContextList, override_settings, compare_xml) -from django.utils import six, unittest as ut2 +from django.utils import six from django.utils.encoding import force_text -from django.utils.unittest import skipIf # Imported here for backward compatibility -from django.utils.unittest.util import safe_repr from django.views.static import serve @@ -155,7 +156,7 @@ class _AssertTemplateNotUsedContext(_AssertTemplateUsedContext): return '%s was rendered.' % self.template_name -class SimpleTestCase(ut2.TestCase): +class SimpleTestCase(unittest.TestCase): # The class we'll use for the test client self.client. # Can be overridden in derived classes. @@ -886,7 +887,7 @@ def _deferredSkip(condition, reason): @wraps(test_func) def skip_wrapper(*args, **kwargs): if condition(): - raise ut2.SkipTest(reason) + raise unittest.SkipTest(reason) return test_func(*args, **kwargs) test_item = skip_wrapper else: |
