parent
7f264e02f4
commit
cfcf4b3605
|
@ -1,8 +1,8 @@
|
|||
import os
|
||||
from unittest import SkipTest
|
||||
|
||||
from django.test import LiveServerTestCase
|
||||
from django.utils.module_loading import import_by_path
|
||||
from django.utils.unittest import SkipTest
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
from django.contrib.admindocs import views
|
||||
from django.db import models
|
||||
from django.db.models import fields
|
||||
from django.utils import unittest
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
from unittest import skipUnless
|
||||
|
||||
from django.conf.global_settings import PASSWORD_HASHERS as default_hashers
|
||||
from django.contrib.auth.hashers import (is_password_usable, BasePasswordHasher,
|
||||
check_password, make_password, PBKDF2PasswordHasher, load_hashers, PBKDF2SHA1PasswordHasher,
|
||||
get_hasher, identify_hasher, UNUSABLE_PASSWORD_PREFIX, UNUSABLE_PASSWORD_SUFFIX_LENGTH)
|
||||
from django.utils import six
|
||||
from django.utils import unittest
|
||||
from django.utils.unittest import skipUnless
|
||||
|
||||
|
||||
try:
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import sys
|
||||
from datetime import date, timedelta
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.auth.tokens import PasswordResetTokenGenerator
|
||||
from django.contrib.auth.tests.utils import skipIfCustomUser
|
||||
from django.test import TestCase
|
||||
from django.utils import unittest
|
||||
|
||||
|
||||
@skipIfCustomUser
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from unittest import skipIf
|
||||
|
||||
from django.conf import settings
|
||||
from django.utils.unittest import skipIf
|
||||
|
||||
|
||||
def skipIfCustomUser(test_func):
|
||||
|
|
|
@ -3,6 +3,7 @@ from __future__ import unicode_literals
|
|||
|
||||
import datetime
|
||||
import os
|
||||
import unittest
|
||||
import warnings
|
||||
|
||||
from django import http
|
||||
|
@ -10,7 +11,6 @@ from django.contrib.formtools import preview, utils
|
|||
from django.test import TestCase
|
||||
from django.test.utils import override_settings
|
||||
from django.utils._os import upath
|
||||
from django.utils import unittest
|
||||
|
||||
from django.contrib.formtools.tests.forms import *
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import unittest
|
||||
from unittest import skipUnless
|
||||
|
||||
from django.contrib.gis.gdal import HAS_GDAL
|
||||
from django.utils import unittest
|
||||
from django.utils.unittest import skipUnless
|
||||
|
||||
if HAS_GDAL:
|
||||
from django.contrib.gis.gdal import Driver, OGRException
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import os
|
||||
import unittest
|
||||
from unittest import skipUnless
|
||||
|
||||
from django.contrib.gis.gdal import HAS_GDAL
|
||||
from django.contrib.gis.geometry.test_data import get_ds_file, TestDS, TEST_DATA
|
||||
from django.utils import unittest
|
||||
from django.utils.unittest import skipUnless
|
||||
|
||||
if HAS_GDAL:
|
||||
from django.contrib.gis.gdal import DataSource, Envelope, OGRGeometry, OGRException, OGRIndexError, GDAL_VERSION
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import unittest
|
||||
from unittest import skipUnless
|
||||
|
||||
from django.contrib.gis.gdal import HAS_GDAL
|
||||
from django.utils import unittest
|
||||
from django.utils.unittest import skipUnless
|
||||
|
||||
if HAS_GDAL:
|
||||
from django.contrib.gis.gdal import Envelope, OGRException
|
||||
|
@ -17,7 +18,7 @@ class EnvelopeTest(unittest.TestCase):
|
|||
|
||||
def setUp(self):
|
||||
self.e = Envelope(0, 0, 5, 5)
|
||||
|
||||
|
||||
def test01_init(self):
|
||||
"Testing Envelope initilization."
|
||||
e1 = Envelope((0, 0, 5, 5))
|
||||
|
|
|
@ -4,12 +4,12 @@ try:
|
|||
from django.utils.six.moves import cPickle as pickle
|
||||
except ImportError:
|
||||
import pickle
|
||||
import unittest
|
||||
from unittest import skipUnless
|
||||
|
||||
from django.contrib.gis.gdal import HAS_GDAL
|
||||
from django.contrib.gis.geometry.test_data import TestDataMixin
|
||||
from django.utils.six.moves import xrange
|
||||
from django.utils import unittest
|
||||
from django.utils.unittest import skipUnless
|
||||
|
||||
if HAS_GDAL:
|
||||
from django.contrib.gis.gdal import (OGRGeometry, OGRGeomType,
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import unittest
|
||||
from unittest import skipUnless
|
||||
|
||||
from django.contrib.gis.gdal import HAS_GDAL
|
||||
from django.utils import unittest
|
||||
from django.utils.unittest import skipUnless
|
||||
|
||||
if HAS_GDAL:
|
||||
from django.contrib.gis.gdal import SpatialReference, CoordTransform, OGRException, SRSException
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import os
|
||||
import unittest
|
||||
from unittest import skipUnless
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.gis.geos import HAS_GEOS
|
||||
from django.contrib.gis.geoip import HAS_GEOIP
|
||||
from django.utils import unittest
|
||||
from django.utils.unittest import skipUnless
|
||||
|
||||
from django.utils import six
|
||||
|
||||
|
|
|
@ -3,6 +3,8 @@ from __future__ import unicode_literals
|
|||
import ctypes
|
||||
import json
|
||||
import random
|
||||
import unittest
|
||||
from unittest import skipUnless
|
||||
from binascii import a2b_hex, b2a_hex
|
||||
from io import BytesIO
|
||||
|
||||
|
@ -14,8 +16,6 @@ from django.contrib.gis.geometry.test_data import TestDataMixin
|
|||
from django.utils.encoding import force_bytes
|
||||
from django.utils import six
|
||||
from django.utils.six.moves import xrange
|
||||
from django.utils import unittest
|
||||
from django.utils.unittest import skipUnless
|
||||
|
||||
from .. import HAS_GEOS
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
# Modified from original contribution by Aryeh Leib Taurog, which was
|
||||
# released under the New BSD license.
|
||||
|
||||
from django.utils import unittest
|
||||
from django.utils.unittest import skipUnless
|
||||
import unittest
|
||||
from unittest import skipUnless
|
||||
|
||||
from .. import HAS_GEOS
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@ from __future__ import unicode_literals
|
|||
|
||||
import binascii
|
||||
import unittest
|
||||
from unittest import skipUnless
|
||||
|
||||
from django.contrib.gis import memoryview
|
||||
from django.utils.unittest import skipUnless
|
||||
|
||||
from ..import HAS_GEOS
|
||||
|
||||
|
|
|
@ -3,9 +3,11 @@
|
|||
#
|
||||
# Modified from original contribution by Aryeh Leib Taurog, which was
|
||||
# released under the New BSD license.
|
||||
|
||||
import unittest
|
||||
|
||||
from django.contrib.gis.geos.mutable_list import ListMixin
|
||||
from django.utils import six
|
||||
from django.utils import unittest
|
||||
|
||||
|
||||
class UserListA(ListMixin):
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
from unittest import skipUnless
|
||||
|
||||
from django.db import connection
|
||||
from django.db.models import Q
|
||||
from django.contrib.gis.geos import HAS_GEOS
|
||||
|
@ -8,7 +10,6 @@ from django.contrib.gis.tests.utils import (
|
|||
HAS_SPATIAL_DB, mysql, oracle, postgis, spatialite, no_oracle, no_spatialite
|
||||
)
|
||||
from django.test import TestCase
|
||||
from django.utils.unittest import skipUnless
|
||||
|
||||
if HAS_GEOS and HAS_SPATIAL_DB:
|
||||
from django.contrib.gis.geos import GEOSGeometry, LineString
|
||||
|
|
|
@ -2,13 +2,13 @@ from __future__ import absolute_import, unicode_literals
|
|||
|
||||
import os
|
||||
import re
|
||||
from unittest import skipUnless
|
||||
|
||||
from django.contrib.gis.gdal import HAS_GDAL
|
||||
from django.contrib.gis.geos import HAS_GEOS
|
||||
from django.contrib.gis.tests.utils import postgis
|
||||
from django.test import TestCase
|
||||
from django.utils._os import upath
|
||||
from django.utils.unittest import skipUnless
|
||||
|
||||
if HAS_GEOS:
|
||||
from django.contrib.gis.db.models import Union, Extent3D
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
from unittest import skipUnless
|
||||
|
||||
from django.test import TestCase
|
||||
from django.contrib.gis.geos import HAS_GEOS
|
||||
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
|
||||
from django.utils.unittest import skipUnless
|
||||
|
||||
if HAS_GEOS and HAS_SPATIAL_DB:
|
||||
from django.contrib.gis import admin
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
from unittest import skipUnless
|
||||
from xml.dom import minidom
|
||||
|
||||
from django.conf import settings
|
||||
|
@ -7,7 +8,6 @@ from django.contrib.sites.models import Site
|
|||
from django.contrib.gis.geos import HAS_GEOS
|
||||
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
|
||||
from django.test import TestCase
|
||||
from django.utils.unittest import skipUnless
|
||||
|
||||
if HAS_GEOS:
|
||||
from .models import City
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from datetime import datetime
|
||||
from unittest import skipUnless
|
||||
|
||||
from django.contrib.gis.geos import HAS_GEOS
|
||||
from django.contrib.gis.tests.utils import no_mysql, no_spatialite
|
||||
|
@ -9,7 +10,6 @@ from django.contrib.gis.shortcuts import render_to_kmz
|
|||
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
|
||||
from django.db.models import Count, Min
|
||||
from django.test import TestCase
|
||||
from django.utils.unittest import skipUnless
|
||||
|
||||
if HAS_GEOS:
|
||||
from .models import City, PennsylvaniaCity, State, Truth
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
from io import BytesIO
|
||||
from unittest import skipUnless
|
||||
from xml.dom import minidom
|
||||
import zipfile
|
||||
|
||||
|
@ -9,7 +10,6 @@ from django.contrib.gis.geos import HAS_GEOS
|
|||
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
|
||||
from django.contrib.sites.models import Site
|
||||
from django.test import TestCase
|
||||
from django.utils.unittest import skipUnless
|
||||
|
||||
if HAS_GEOS:
|
||||
from .models import City, Country
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
import re
|
||||
from unittest import skipUnless
|
||||
|
||||
from django.db import connection
|
||||
from django.contrib.gis import gdal
|
||||
|
@ -10,7 +11,6 @@ from django.contrib.gis.tests.utils import (
|
|||
mysql, oracle, postgis, spatialite)
|
||||
from django.test import TestCase
|
||||
from django.utils import six, unittest
|
||||
from django.utils.unittest import skipUnless
|
||||
|
||||
if HAS_GEOS:
|
||||
from django.contrib.gis.geos import (fromstr, GEOSGeometry,
|
||||
|
|
|
@ -4,6 +4,7 @@ Tests for geography support in PostGIS 1.5+
|
|||
from __future__ import absolute_import
|
||||
|
||||
import os
|
||||
from unittest import skipUnless
|
||||
|
||||
from django.contrib.gis.gdal import HAS_GDAL
|
||||
from django.contrib.gis.geos import HAS_GEOS
|
||||
|
@ -11,7 +12,6 @@ from django.contrib.gis.measure import D
|
|||
from django.contrib.gis.tests.utils import postgis
|
||||
from django.test import TestCase
|
||||
from django.utils._os import upath
|
||||
from django.utils.unittest import skipUnless
|
||||
|
||||
if HAS_GEOS:
|
||||
from .models import City, County, Zipcode
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
import os
|
||||
from unittest import skipUnless
|
||||
|
||||
from django.db import connections
|
||||
from django.test import TestCase
|
||||
from django.contrib.gis.gdal import HAS_GDAL
|
||||
from django.contrib.gis.geometry.test_data import TEST_DATA
|
||||
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
|
||||
from django.utils.unittest import skipUnless
|
||||
|
||||
if HAS_GDAL:
|
||||
from django.contrib.gis.gdal import Driver
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
# coding: utf-8
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
import os
|
||||
from copy import copy
|
||||
from decimal import Decimal
|
||||
import os
|
||||
import unittest
|
||||
from unittest import skipUnless
|
||||
|
||||
from django.contrib.gis.gdal import HAS_GDAL
|
||||
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB, mysql
|
||||
from django.db import router
|
||||
from django.conf import settings
|
||||
from django.test import TestCase
|
||||
from django.utils import unittest
|
||||
from django.utils.unittest import skipUnless
|
||||
from django.utils._os import upath
|
||||
|
||||
if HAS_GDAL:
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
from unittest import skipUnless
|
||||
|
||||
from django.contrib.gis.geos import HAS_GEOS
|
||||
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB, mysql, oracle, no_mysql, no_oracle, no_spatialite
|
||||
from django.test import TestCase
|
||||
from django.utils.unittest import skipUnless
|
||||
|
||||
if HAS_GEOS:
|
||||
from django.contrib.gis.db.models import Collect, Count, Extent, F, Union
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
from unittest import skipUnless
|
||||
|
||||
from django.forms import ValidationError
|
||||
from django.contrib.gis.gdal import HAS_GDAL
|
||||
from django.contrib.gis.tests.utils import HAS_SPATIALREFSYS
|
||||
from django.test import SimpleTestCase
|
||||
from django.utils import six
|
||||
from django.utils.unittest import skipUnless
|
||||
|
||||
|
||||
if HAS_SPATIALREFSYS:
|
||||
from django.contrib.gis import forms
|
||||
from django.contrib.gis.geos import GEOSGeometry
|
||||
|
||||
|
||||
@skipUnless(HAS_GDAL and HAS_SPATIALREFSYS, "GeometryFieldTest needs gdal support and a spatial database")
|
||||
class GeometryFieldTest(SimpleTestCase):
|
||||
|
||||
|
@ -143,7 +144,7 @@ class SpecializedFieldTest(SimpleTestCase):
|
|||
|
||||
def assertTextarea(self, geom, rendered):
|
||||
"""Makes sure the wkt and a textarea are in the content"""
|
||||
|
||||
|
||||
self.assertIn('<textarea ', rendered)
|
||||
self.assertIn('required', rendered)
|
||||
self.assertIn(geom.wkt, rendered)
|
||||
|
|
|
@ -3,8 +3,9 @@ Distance and Area objects to allow for sensible and convienient calculation
|
|||
and conversions. Here are some tests.
|
||||
"""
|
||||
|
||||
import unittest
|
||||
|
||||
from django.contrib.gis.measure import Distance, Area, D, A
|
||||
from django.utils import unittest
|
||||
|
||||
|
||||
class DistanceTest(unittest.TestCase):
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import unittest
|
||||
|
||||
from django.contrib.gis.gdal import HAS_GDAL
|
||||
from django.contrib.gis.tests.utils import (no_mysql, oracle, postgis,
|
||||
spatialite, HAS_SPATIALREFSYS, SpatialRefSys)
|
||||
from django.utils import six
|
||||
from django.utils import unittest
|
||||
|
||||
|
||||
test_srs = ({'srid' : 4326,
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from __future__ import unicode_literals
|
||||
import datetime
|
||||
from decimal import Decimal
|
||||
from unittest import skipIf
|
||||
|
||||
try:
|
||||
import pytz
|
||||
|
@ -17,7 +18,6 @@ from django.utils.timezone import utc
|
|||
from django.utils import translation
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.utils import tzinfo
|
||||
from django.utils.unittest import skipIf
|
||||
|
||||
from i18n import TransRealMixin
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
from unittest import skipIf
|
||||
|
||||
from django import http
|
||||
from django.conf import settings, global_settings
|
||||
from django.contrib.messages import constants, utils, get_level, set_level
|
||||
|
@ -7,7 +9,6 @@ from django.contrib.messages.storage.base import Message
|
|||
from django.core.urlresolvers import reverse
|
||||
from django.test.utils import override_settings
|
||||
from django.utils.translation import ugettext_lazy
|
||||
from django.utils.unittest import skipIf
|
||||
|
||||
|
||||
def skipUnlessAuthIsInstalled(func):
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import unittest
|
||||
|
||||
from django import http
|
||||
from django.contrib.messages.middleware import MessageMiddleware
|
||||
from django.utils import unittest
|
||||
|
||||
|
||||
class MiddlewareTest(unittest.TestCase):
|
||||
|
|
|
@ -4,6 +4,7 @@ import os
|
|||
import shutil
|
||||
import string
|
||||
import tempfile
|
||||
import unittest
|
||||
import warnings
|
||||
|
||||
from django.conf import settings
|
||||
|
@ -22,7 +23,6 @@ from django.test import TestCase, RequestFactory
|
|||
from django.test.utils import override_settings, patch_logger
|
||||
from django.utils import six
|
||||
from django.utils import timezone
|
||||
from django.utils import unittest
|
||||
|
||||
from django.contrib.sessions.exceptions import InvalidSessionKey
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from unittest import skipUnless
|
||||
|
||||
from django.conf import settings
|
||||
from django.utils.unittest import skipUnless
|
||||
|
||||
from .base import SitemapTestsBase
|
||||
|
||||
|
|
|
@ -2,13 +2,13 @@ from __future__ import unicode_literals
|
|||
|
||||
import os
|
||||
from datetime import date
|
||||
from unittest import skipUnless
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.sitemaps import Sitemap, GenericSitemap
|
||||
from django.contrib.sites.models import Site
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.test.utils import override_settings
|
||||
from django.utils.unittest import skipUnless
|
||||
from django.utils.formats import localize
|
||||
from django.utils._os import upath
|
||||
from django.utils.translation import activate, deactivate
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -37,7 +37,7 @@ Example
|
|||
|
||||
The following is a simple unit test using the request factory::
|
||||
|
||||
from django.utils import unittest
|
||||
import unittest
|
||||
from django.test.client import RequestFactory
|
||||
|
||||
class SimpleTest(unittest.TestCase):
|
||||
|
|
|
@ -800,7 +800,7 @@ Example
|
|||
|
||||
The following is a simple unit test using the test client::
|
||||
|
||||
from django.utils import unittest
|
||||
import unittest
|
||||
from django.test.client import Client
|
||||
|
||||
class SimpleTest(unittest.TestCase):
|
||||
|
@ -1143,7 +1143,7 @@ worry about state (such as cookies) carrying over from one test to another.
|
|||
|
||||
This means, instead of instantiating a ``Client`` in each test::
|
||||
|
||||
from django.utils import unittest
|
||||
import unittest
|
||||
from django.test.client import Client
|
||||
|
||||
class SimpleTest(unittest.TestCase):
|
||||
|
|
|
@ -6,13 +6,14 @@ and default settings.py files.
|
|||
"""
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import codecs
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import socket
|
||||
import subprocess
|
||||
import sys
|
||||
import codecs
|
||||
import unittest
|
||||
|
||||
import django
|
||||
from django import conf, get_version
|
||||
|
@ -20,7 +21,6 @@ from django.conf import settings
|
|||
from django.core.management import BaseCommand, CommandError
|
||||
from django.db import connection
|
||||
from django.test.runner import DiscoverRunner
|
||||
from django.utils import unittest
|
||||
from django.utils.encoding import force_text
|
||||
from django.utils._os import upath
|
||||
from django.utils.six import StringIO
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from datetime import datetime
|
||||
from unittest import TestCase
|
||||
|
||||
from django import forms
|
||||
from django.conf import settings
|
||||
|
@ -16,7 +17,6 @@ from django.test.utils import override_settings
|
|||
from django.utils import six
|
||||
from django.utils import translation
|
||||
from django.utils.html import conditional_escape
|
||||
from django.utils.unittest import TestCase
|
||||
|
||||
from . import models
|
||||
from .widgetadmin import site as widget_admin_site
|
||||
|
|
|
@ -10,7 +10,6 @@ from django.contrib.contenttypes.models import ContentType
|
|||
from django.db.models import Count, Max, Avg, Sum, StdDev, Variance, F, Q
|
||||
from django.test import TestCase, Approximate, skipUnlessDBFeature
|
||||
from django.utils import six
|
||||
from django.utils.unittest import expectedFailure
|
||||
|
||||
from .models import (Author, Book, Publisher, Clues, Entries, HardbackBook,
|
||||
ItemTag, WithManualPK)
|
||||
|
|
|
@ -4,11 +4,12 @@ import copy
|
|||
import os
|
||||
import sys
|
||||
import time
|
||||
from unittest import TestCase
|
||||
|
||||
from django.conf import Settings
|
||||
from django.db.models.loading import cache, load_app, get_model, get_models
|
||||
from django.utils._os import upath
|
||||
from django.utils.unittest import TestCase
|
||||
|
||||
|
||||
class EggLoadingTest(TestCase):
|
||||
|
||||
|
|
|
@ -3,10 +3,10 @@ A series of tests to establish that the command-line bash completion works.
|
|||
"""
|
||||
import os
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
from django.conf import settings
|
||||
from django.core.management import ManagementUtility
|
||||
from django.utils import unittest
|
||||
from django.utils.six import StringIO
|
||||
|
||||
|
||||
|
|
|
@ -8,9 +8,9 @@ from __future__ import absolute_import
|
|||
|
||||
import os
|
||||
import shutil
|
||||
import unittest
|
||||
|
||||
from django.core.files.uploadedfile import SimpleUploadedFile
|
||||
from django.utils import unittest
|
||||
from django.utils._os import upath
|
||||
|
||||
from .models import Photo, PhotoForm, temp_storage_dir
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from unittest import TestCase
|
||||
|
||||
from django.contrib import admin
|
||||
from django.utils.unittest import TestCase
|
||||
|
||||
|
||||
class Bug8245Test(TestCase):
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from io import BytesIO
|
||||
from unittest import TestCase
|
||||
|
||||
from django.core.servers.basehttp import ServerHandler, MAX_SOCKET_CHUNK_SIZE
|
||||
from django.utils.unittest import TestCase
|
||||
|
||||
|
||||
class DummyHandler(object):
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
# Unit tests for typecast functions in django.db.backends.util
|
||||
|
||||
import datetime
|
||||
import unittest
|
||||
|
||||
from django.db.backends import util as typecasts
|
||||
from django.utils import six
|
||||
from django.utils import unittest
|
||||
|
||||
|
||||
TEST_CASES = {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from functools import wraps
|
||||
from unittest import TestCase
|
||||
|
||||
from django.contrib.admin.views.decorators import staff_member_required
|
||||
from django.contrib.auth.decorators import login_required, permission_required, user_passes_test
|
||||
|
@ -6,7 +7,6 @@ from django.http import HttpResponse, HttpRequest, HttpResponseNotAllowed
|
|||
from django.middleware.clickjacking import XFrameOptionsMiddleware
|
||||
from django.utils.decorators import method_decorator
|
||||
from django.utils.functional import allow_lazy, lazy, memoize
|
||||
from django.utils.unittest import TestCase
|
||||
from django.views.decorators.cache import cache_page, never_cache, cache_control
|
||||
from django.views.decorators.clickjacking import xframe_options_deny, xframe_options_sameorigin, xframe_options_exempt
|
||||
from django.views.decorators.http import require_http_methods, require_GET, require_POST, require_safe, condition
|
||||
|
|
|
@ -3,11 +3,12 @@ from __future__ import unicode_literals
|
|||
|
||||
import datetime
|
||||
import decimal
|
||||
import unittest
|
||||
|
||||
from django.template.defaultfilters import *
|
||||
from django.test import TestCase
|
||||
from django.utils import six
|
||||
from django.utils import unittest, translation
|
||||
from django.utils import translation
|
||||
from django.utils.safestring import SafeData
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import gc
|
||||
import sys
|
||||
import time
|
||||
import unittest
|
||||
|
||||
from django.dispatch import Signal, receiver
|
||||
from django.utils import unittest
|
||||
|
||||
|
||||
if sys.platform.startswith('java'):
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import unittest
|
||||
|
||||
from django.dispatch.saferef import safeRef
|
||||
from django.utils.six.moves import xrange
|
||||
from django.utils import unittest
|
||||
|
||||
class Test1(object):
|
||||
def x(self):
|
||||
|
|
|
@ -7,6 +7,7 @@ import shutil
|
|||
import sys
|
||||
import tempfile
|
||||
import time
|
||||
import unittest
|
||||
try:
|
||||
from urllib.request import urlopen
|
||||
except ImportError: # Python 2
|
||||
|
@ -28,7 +29,6 @@ from django.core.files.storage import FileSystemStorage, get_storage_class
|
|||
from django.core.files.uploadedfile import UploadedFile
|
||||
from django.test import LiveServerTestCase, SimpleTestCase
|
||||
from django.utils import six
|
||||
from django.utils import unittest
|
||||
from django.utils._os import upath
|
||||
from django.test.utils import override_settings
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ import json
|
|||
import os
|
||||
import shutil
|
||||
import tempfile as sys_tempfile
|
||||
import unittest
|
||||
|
||||
from django.core.files import temp as tempfile
|
||||
from django.core.files.uploadedfile import SimpleUploadedFile
|
||||
|
@ -16,7 +17,6 @@ from django.test import TestCase, client
|
|||
from django.test.utils import override_settings
|
||||
from django.utils.encoding import force_bytes
|
||||
from django.utils.six import StringIO
|
||||
from django.utils import unittest
|
||||
|
||||
from . import uploadhandler
|
||||
from .models import FileModel
|
||||
|
|
|
@ -4,6 +4,7 @@ import os
|
|||
import gzip
|
||||
import shutil
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
from django.core.cache import cache
|
||||
from django.core.files import File
|
||||
|
@ -11,7 +12,6 @@ from django.core.files.move import file_move_safe
|
|||
from django.core.files.base import ContentFile
|
||||
from django.core.files.uploadedfile import SimpleUploadedFile
|
||||
from django.test import TestCase
|
||||
from django.utils import unittest
|
||||
from django.utils.six import StringIO
|
||||
|
||||
from .models import Storage, temp_storage, temp_storage_location
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from unittest import TestCase
|
||||
|
||||
from django import forms
|
||||
from django.core import validators
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.utils.unittest import TestCase
|
||||
|
||||
|
||||
class UserForm(forms.Form):
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
import time
|
||||
import unittest
|
||||
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.http import HttpResponse
|
||||
from django.test import TestCase, RequestFactory
|
||||
from django.utils import unittest
|
||||
from django.views.generic import View, TemplateView, RedirectView
|
||||
|
||||
from . import views
|
||||
|
|
|
@ -2,12 +2,12 @@ from __future__ import absolute_import
|
|||
|
||||
import time
|
||||
import datetime
|
||||
from unittest import skipUnless
|
||||
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.test import TestCase, skipUnlessDBFeature
|
||||
from django.test.utils import override_settings
|
||||
from django.utils import timezone
|
||||
from django.utils.unittest import skipUnless
|
||||
|
||||
from .models import Book, BookSigning
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
import warnings
|
||||
from unittest import expectedFailure
|
||||
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.core.urlresolvers import reverse
|
||||
from django import forms
|
||||
from django.test import TestCase
|
||||
from django.utils.unittest import expectedFailure
|
||||
from django.test.client import RequestFactory
|
||||
from django.views.generic.base import View
|
||||
from django.views.generic.edit import FormMixin, CreateView
|
||||
|
|
|
@ -4,6 +4,7 @@ from __future__ import unicode_literals
|
|||
import copy
|
||||
import os
|
||||
import pickle
|
||||
import unittest
|
||||
import warnings
|
||||
|
||||
from django.core.exceptions import SuspiciousOperation
|
||||
|
@ -18,7 +19,6 @@ from django.test import TestCase
|
|||
from django.utils.encoding import smart_str
|
||||
from django.utils._os import upath
|
||||
from django.utils import six
|
||||
from django.utils import unittest
|
||||
|
||||
|
||||
class QueryDictTests(unittest.TestCase):
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
from unittest import skipUnless
|
||||
|
||||
from django.core.management.color import no_style
|
||||
from django.db import connections, DEFAULT_DB_ALIAS
|
||||
from django.test import TestCase
|
||||
from django.utils.unittest import skipUnless
|
||||
|
||||
from .models import Article
|
||||
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
import re
|
||||
from unittest import expectedFailure
|
||||
|
||||
from django.core.management import call_command
|
||||
from django.db import connection
|
||||
from django.test import TestCase, skipUnlessDBFeature
|
||||
from django.utils.unittest import expectedFailure
|
||||
from django.utils.six import PY3, StringIO
|
||||
|
||||
if connection.vendor == 'oracle':
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
from django.db import connection
|
||||
from django.test import TestCase, skipUnlessDBFeature, skipIfDBFeature
|
||||
from django.utils import unittest
|
||||
|
||||
from .models import Reporter, Article
|
||||
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
import copy
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
from django.core.management.validation import get_validation_errors
|
||||
from django.db.models.loading import cache, load_app
|
||||
|
||||
from django.test.utils import override_settings
|
||||
from django.utils import unittest
|
||||
from django.utils.six import StringIO
|
||||
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ from __future__ import unicode_literals
|
|||
import copy
|
||||
import logging
|
||||
import sys
|
||||
from unittest import skipUnless
|
||||
import warnings
|
||||
|
||||
from django.conf import LazySettings
|
||||
|
@ -13,7 +14,6 @@ from django.utils.encoding import force_text
|
|||
from django.utils.log import (CallbackFilter, RequireDebugFalse,
|
||||
RequireDebugTrue)
|
||||
from django.utils.six import StringIO
|
||||
from django.utils.unittest import skipUnless
|
||||
|
||||
from admin_scripts.tests import AdminScriptTestCase
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
from django.utils import unittest
|
||||
import unittest
|
||||
|
||||
from .models import PersonWithDefaultMaxLengths, PersonWithCustomMaxLengths
|
||||
|
||||
|
@ -36,4 +36,4 @@ class MaxLengthORMTests(unittest.TestCase):
|
|||
new_args = args.copy()
|
||||
new_args[field] = "X" * 250 # a value longer than any of the default fields could hold.
|
||||
p = PersonWithCustomMaxLengths.objects.create(**new_args)
|
||||
self.assertEqual(getattr(p, field), ("X" * 250))
|
||||
self.assertEqual(getattr(p, field), ("X" * 250))
|
||||
|
|
|
@ -5,6 +5,7 @@ import gzip
|
|||
from io import BytesIO
|
||||
import random
|
||||
import re
|
||||
from unittest import expectedFailure, skipIf
|
||||
import warnings
|
||||
|
||||
from django.conf import settings
|
||||
|
@ -22,7 +23,6 @@ from django.test.utils import override_settings, IgnoreDeprecationWarningsMixin
|
|||
from django.utils import six
|
||||
from django.utils.encoding import force_str
|
||||
from django.utils.six.moves import xrange
|
||||
from django.utils.unittest import expectedFailure, skipIf
|
||||
|
||||
from .models import Band
|
||||
|
||||
|
|
|
@ -2,13 +2,13 @@ from __future__ import absolute_import
|
|||
|
||||
import os
|
||||
import shutil
|
||||
from unittest import skipIf
|
||||
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.core.files import File
|
||||
from django.core.files.images import ImageFile
|
||||
from django.test import TestCase
|
||||
from django.utils._os import upath
|
||||
from django.utils.unittest import skipIf
|
||||
|
||||
try:
|
||||
from .models import Image
|
||||
|
|
|
@ -2,6 +2,7 @@ from __future__ import absolute_import, unicode_literals
|
|||
|
||||
import datetime
|
||||
from decimal import Decimal
|
||||
import unittest
|
||||
|
||||
from django import test
|
||||
from django import forms
|
||||
|
@ -9,7 +10,6 @@ from django.core.exceptions import ValidationError
|
|||
from django.db import connection, models, IntegrityError
|
||||
from django.db.models.fields.files import FieldFile
|
||||
from django.utils import six
|
||||
from django.utils import unittest
|
||||
|
||||
from .models import (Foo, Bar, Whiz, BigD, BigS, Image, BigInt, Post,
|
||||
NullBooleanModel, BooleanModel, DataModel, Document, RenamedField,
|
||||
|
|
|
@ -3,6 +3,7 @@ from __future__ import absolute_import, unicode_literals
|
|||
import datetime
|
||||
import os
|
||||
from decimal import Decimal
|
||||
from unittest import skipUnless
|
||||
import warnings
|
||||
|
||||
from django import forms
|
||||
|
@ -13,7 +14,6 @@ from django.db import connection
|
|||
from django.db.models.query import EmptyQuerySet
|
||||
from django.forms.models import model_to_dict
|
||||
from django.utils._os import upath
|
||||
from django.utils.unittest import skipUnless
|
||||
from django.test import TestCase
|
||||
from django.utils import six
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from datetime import date
|
||||
import unittest
|
||||
import warnings
|
||||
|
||||
from django import forms
|
||||
|
@ -9,7 +10,6 @@ from django.core.files.uploadedfile import SimpleUploadedFile
|
|||
from django.forms.models import (modelform_factory, ModelChoiceField,
|
||||
fields_for_model, construct_instance, ModelFormMetaclass)
|
||||
from django.utils import six
|
||||
from django.utils import unittest
|
||||
from django.test import TestCase
|
||||
|
||||
from .models import (Person, RealPerson, Triple, FilePathModel, Article,
|
||||
|
|
|
@ -5,10 +5,10 @@ from __future__ import absolute_import, unicode_literals
|
|||
|
||||
import datetime
|
||||
from operator import attrgetter
|
||||
from django import forms
|
||||
from unittest import expectedFailure
|
||||
|
||||
from django import forms
|
||||
from django.test import TestCase
|
||||
from django.utils.unittest import expectedFailure
|
||||
|
||||
from .models import (Place, Restaurant, ItalianRestaurant, ParkingLot,
|
||||
ParkingLot2, ParkingLot3, Supplier, Wholesaler, Child, SelfRefParent,
|
||||
|
|
|
@ -3,12 +3,12 @@ from __future__ import absolute_import, unicode_literals
|
|||
import datetime
|
||||
from operator import attrgetter
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.test import TestCase, skipUnlessDBFeature
|
||||
from django.utils import six
|
||||
from django.utils import tzinfo
|
||||
from django.utils import unittest
|
||||
from django.db import connection, router
|
||||
from django.db.models.sql import InsertQuery
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from datetime import date
|
||||
import unittest
|
||||
|
||||
from django import forms
|
||||
from django.conf import settings
|
||||
|
@ -15,7 +16,7 @@ from django.forms.models import BaseModelFormSet
|
|||
from django.forms.widgets import Select
|
||||
from django.test import TestCase
|
||||
from django.test.utils import str_prefix
|
||||
from django.utils import unittest, six
|
||||
from django.utils import six
|
||||
|
||||
from .models import Band, Concert, ValidationTestModel, ValidationTestInlineModel
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from datetime import datetime
|
||||
import unittest
|
||||
|
||||
from django.core.paginator import (Paginator, EmptyPage, InvalidPage,
|
||||
PageNotAnInteger)
|
||||
from django.test import TestCase
|
||||
from django.utils import six
|
||||
from django.utils import unittest
|
||||
|
||||
from .models import Article
|
||||
from .custom import ValidAdjacentNumsPaginator
|
||||
|
|
|
@ -4,6 +4,7 @@ import datetime
|
|||
from operator import attrgetter
|
||||
import pickle
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
from django.conf import settings
|
||||
from django.core.exceptions import FieldError
|
||||
|
@ -13,7 +14,6 @@ from django.db.models.sql.where import WhereNode, EverythingNode, NothingNode
|
|||
from django.db.models.sql.datastructures import EmptyResultSet
|
||||
from django.test import TestCase, skipUnlessDBFeature
|
||||
from django.test.utils import str_prefix
|
||||
from django.utils import unittest
|
||||
from django.utils.datastructures import SortedDict
|
||||
|
||||
from .models import (
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import time
|
||||
import warnings
|
||||
from datetime import datetime, timedelta
|
||||
from io import BytesIO
|
||||
import time
|
||||
from unittest import skipIf
|
||||
import warnings
|
||||
|
||||
from django.db import connection, connections, DEFAULT_DB_ALIAS
|
||||
from django.core import signals
|
||||
|
@ -15,7 +16,6 @@ from django.test import SimpleTestCase, TransactionTestCase
|
|||
from django.test.client import FakePayload
|
||||
from django.test.utils import override_settings, str_prefix
|
||||
from django.utils import six
|
||||
from django.utils.unittest import skipIf
|
||||
from django.utils.http import cookie_date, urlencode
|
||||
from django.utils.timezone import utc
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from unittest import TestCase
|
||||
|
||||
from django.core.urlresolvers import NoReverseMatch
|
||||
from django.contrib.auth.views import logout
|
||||
from django.utils.unittest import TestCase
|
||||
from django.shortcuts import resolve_url
|
||||
|
||||
from .models import UnimportantThing
|
||||
|
|
|
@ -2,13 +2,13 @@ from __future__ import absolute_import
|
|||
|
||||
import sys
|
||||
import time
|
||||
import unittest
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import transaction, connection
|
||||
from django.db.utils import ConnectionHandler, DEFAULT_DB_ALIAS, DatabaseError
|
||||
from django.test import (TransactionTestCase, skipIfDBFeature,
|
||||
skipUnlessDBFeature)
|
||||
from django.utils import unittest
|
||||
|
||||
from .models import Person
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
import unittest
|
||||
|
||||
from django.test import TestCase
|
||||
from django.utils import unittest
|
||||
|
||||
from .models import (User, UserProfile, UserStat, UserStatResult, StatDetails,
|
||||
AdvancedUserStat, Image, Product, Parent1, Parent2, Child1, Child2, Child3,
|
||||
|
|
|
@ -3,6 +3,7 @@ from __future__ import absolute_import, unicode_literals
|
|||
# -*- coding: utf-8 -*-
|
||||
import json
|
||||
from datetime import datetime
|
||||
import unittest
|
||||
from xml.dom import minidom
|
||||
|
||||
from django.conf import settings
|
||||
|
@ -11,7 +12,6 @@ from django.db import transaction, connection
|
|||
from django.test import TestCase, TransactionTestCase, Approximate
|
||||
from django.utils import six
|
||||
from django.utils.six import StringIO
|
||||
from django.utils import unittest
|
||||
|
||||
from .models import (Category, Author, Article, AuthorProfile, Actor, Movie,
|
||||
Score, Player, Team)
|
||||
|
|
|
@ -10,7 +10,7 @@ from __future__ import absolute_import, unicode_literals
|
|||
|
||||
import datetime
|
||||
import decimal
|
||||
from django.core.serializers.xml_serializer import DTDForbidden
|
||||
from unittest import expectedFailure, skipUnless
|
||||
|
||||
try:
|
||||
import yaml
|
||||
|
@ -20,13 +20,13 @@ except ImportError:
|
|||
from django.core import serializers
|
||||
from django.core.serializers import SerializerDoesNotExist
|
||||
from django.core.serializers.base import DeserializationError
|
||||
from django.core.serializers.xml_serializer import DTDForbidden
|
||||
from django.db import connection, models
|
||||
from django.http import HttpResponse
|
||||
from django.test import TestCase
|
||||
from django.utils import six
|
||||
from django.utils.encoding import force_text
|
||||
from django.utils.functional import curry
|
||||
from django.utils.unittest import expectedFailure, skipUnless
|
||||
|
||||
from .models import (BinaryData, BooleanData, CharData, DateData, DateTimeData, EmailData,
|
||||
FileData, FilePathData, DecimalData, FloatData, IntegerData, IPAddressData,
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import os
|
||||
import unittest
|
||||
import warnings
|
||||
|
||||
from django.conf import settings, global_settings
|
||||
|
@ -6,7 +7,7 @@ from django.core.exceptions import ImproperlyConfigured
|
|||
from django.http import HttpRequest
|
||||
from django.test import SimpleTestCase, TransactionTestCase, TestCase, signals
|
||||
from django.test.utils import override_settings
|
||||
from django.utils import unittest, six
|
||||
from django.utils import six
|
||||
|
||||
|
||||
@override_settings(TEST='override', TEST_OUTER='outer')
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
import datetime
|
||||
from unittest import skipIf
|
||||
|
||||
from django.test import TestCase
|
||||
from django.utils import six
|
||||
from django.utils.unittest import skipIf
|
||||
|
||||
from .models import Article, BrokenArticle, InternationalArticle
|
||||
|
||||
|
|
|
@ -9,15 +9,16 @@ from django.conf import settings
|
|||
if __name__ == '__main__':
|
||||
settings.configure()
|
||||
|
||||
import sys
|
||||
import pkg_resources
|
||||
import imp
|
||||
import os.path
|
||||
import pkg_resources
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
from django.template import TemplateDoesNotExist, Context
|
||||
from django.template.loaders.eggs import Loader as EggLoader
|
||||
from django.template import loader
|
||||
from django.utils import unittest, six
|
||||
from django.utils import six
|
||||
from django.utils._os import upath
|
||||
from django.utils.six import StringIO
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from unittest import TestCase
|
||||
|
||||
from django import template
|
||||
from django.utils.unittest import TestCase
|
||||
|
||||
class CallableVariablesTests(TestCase):
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
# coding: utf-8
|
||||
|
||||
from unittest import TestCase
|
||||
|
||||
from django.template import Context
|
||||
from django.utils.unittest import TestCase
|
||||
|
||||
|
||||
class ContextTests(TestCase):
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from unittest import TestCase
|
||||
|
||||
from django import template
|
||||
from django.utils import six
|
||||
from django.utils.unittest import TestCase
|
||||
|
||||
from .templatetags import custom
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from unittest import TestCase
|
||||
|
||||
from django.template import VariableNode, Context
|
||||
from django.template.loader import get_template_from_string
|
||||
from django.utils.unittest import TestCase
|
||||
from django.test.utils import override_settings
|
||||
|
||||
class NodelistTest(TestCase):
|
||||
|
|
|
@ -3,10 +3,11 @@ Testing some internals of the template processing. These are *not* examples to b
|
|||
"""
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from unittest import TestCase
|
||||
|
||||
from django.template import (TokenParser, FilterExpression, Parser, Variable,
|
||||
Template, TemplateSyntaxError)
|
||||
from django.test.utils import override_settings
|
||||
from django.utils.unittest import TestCase
|
||||
from django.utils import six
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import unittest
|
||||
|
||||
from django.template.smartif import IfParser
|
||||
from django.utils import unittest
|
||||
|
||||
class SmartIfTests(unittest.TestCase):
|
||||
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from unittest import TestCase
|
||||
|
||||
from django.template import Template, TemplateEncodingError, Context
|
||||
from django.utils.safestring import SafeData
|
||||
from django.utils import six
|
||||
from django.utils.unittest import TestCase
|
||||
|
||||
|
||||
class UnicodeTests(TestCase):
|
||||
|
|
|
@ -13,6 +13,7 @@ import time
|
|||
import os
|
||||
import sys
|
||||
import traceback
|
||||
import unittest
|
||||
try:
|
||||
from urllib.parse import urljoin
|
||||
except ImportError: # Python 2
|
||||
|
@ -27,7 +28,6 @@ from django.template.loaders import app_directories, filesystem, cached
|
|||
from django.test import RequestFactory, TestCase
|
||||
from django.test.utils import (setup_test_template_loader,
|
||||
restore_template_loaders, override_settings)
|
||||
from django.utils import unittest
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
from django.utils.formats import date_format
|
||||
from django.utils._os import upath
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
from contextlib import contextmanager
|
||||
import os
|
||||
import sys
|
||||
from unittest import expectedFailure
|
||||
|
||||
from django.test import TestCase
|
||||
from django.test.runner import DiscoverRunner
|
||||
from django.utils.unittest import expectedFailure
|
||||
|
||||
try:
|
||||
import unittest2
|
||||
|
|
|
@ -3,8 +3,9 @@ Tests for django test runner
|
|||
"""
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
import sys
|
||||
from optparse import make_option
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
from django.core.exceptions import ImproperlyConfigured
|
||||
from django.core.management import call_command
|
||||
|
@ -12,7 +13,6 @@ from django import db
|
|||
from django.test import runner, TestCase, TransactionTestCase, skipUnlessDBFeature
|
||||
from django.test.testcases import connections_support_transactions
|
||||
from django.test.utils import IgnoreDeprecationWarningsMixin
|
||||
from django.utils import unittest
|
||||
from django.utils.importlib import import_module
|
||||
|
||||
from admin_scripts.tests import AdminScriptTestCase
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import unittest
|
||||
|
||||
from django.db.models import get_app
|
||||
from django.test.utils import IgnoreDeprecationWarningsMixin
|
||||
from django.utils import unittest
|
||||
|
||||
|
||||
def suite():
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
import unittest
|
||||
from unittest import skip
|
||||
|
||||
from django.db import connection
|
||||
from django.forms import EmailField, IntegerField
|
||||
from django.http import HttpResponse
|
||||
|
@ -9,8 +12,6 @@ from django.test import SimpleTestCase, TestCase, skipUnlessDBFeature
|
|||
from django.test.html import HTMLParseError, parse_html
|
||||
from django.test.utils import CaptureQueriesContext, IgnoreDeprecationWarningsMixin
|
||||
from django.utils import six
|
||||
from django.utils import unittest
|
||||
from django.utils.unittest import skip
|
||||
|
||||
from .models import Person
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import os
|
|||
import re
|
||||
import sys
|
||||
import time
|
||||
from unittest import skipIf, skipUnless
|
||||
import warnings
|
||||
from xml.dom.minidom import parseString
|
||||
|
||||
|
@ -25,7 +26,6 @@ from django.test.utils import override_settings
|
|||
from django.utils import six
|
||||
from django.utils import timezone
|
||||
from django.utils.tzinfo import FixedOffset
|
||||
from django.utils.unittest import skipIf, skipUnless
|
||||
|
||||
from .forms import EventForm, EventSplitForm, EventModelForm
|
||||
from .models import Event, MaybeEvent, Session, SessionEvent, Timestamp, AllDayEvent
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
import sys
|
||||
from unittest import skipIf, skipUnless
|
||||
|
||||
from django.db import connection, transaction, DatabaseError, IntegrityError
|
||||
from django.test import TransactionTestCase, skipUnlessDBFeature
|
||||
from django.test.utils import IgnoreDeprecationWarningsMixin
|
||||
from django.utils import six
|
||||
from django.utils.unittest import skipIf, skipUnless
|
||||
|
||||
from .models import Reporter
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue