mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
@@ -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):
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user