1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +00:00

Imported override_settings from its new location.

This commit is contained in:
Aymeric Augustin 2013-12-23 16:01:13 +01:00
parent da16bb30ff
commit e32095616c
91 changed files with 113 additions and 154 deletions

View File

@ -10,8 +10,7 @@ from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ImproperlyConfigured, PermissionDenied from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.contrib.auth import authenticate, get_user from django.contrib.auth import authenticate, get_user
from django.http import HttpRequest from django.http import HttpRequest
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
from django.contrib.auth.hashers import MD5PasswordHasher from django.contrib.auth.hashers import MD5PasswordHasher

View File

@ -11,9 +11,8 @@ from django.contrib.auth.tests.utils import skipIfCustomUser
from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ImproperlyConfigured
from django.core.management import call_command from django.core.management import call_command
from django.dispatch import receiver from django.dispatch import receiver
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.signals import setting_changed from django.test.signals import setting_changed
from django.test.utils import override_settings
from django.utils import translation from django.utils import translation
from django.utils.encoding import force_str from django.utils.encoding import force_str
from django.utils.six import binary_type, PY2, StringIO from django.utils.six import binary_type, PY2, StringIO

View File

@ -7,8 +7,7 @@ from django.contrib.auth.models import User, Permission
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.context_processors import PermWrapper, PermLookupDict from django.contrib.auth.context_processors import PermWrapper, PermLookupDict
from django.db.models import Q from django.db.models import Q
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
from django.utils._os import upath from django.utils._os import upath

View File

@ -12,8 +12,7 @@ from django.contrib.auth.forms import (UserCreationForm, AuthenticationForm,
from django.contrib.auth.tests.utils import skipIfCustomUser from django.contrib.auth.tests.utils import skipIfCustomUser
from django.core import mail from django.core import mail
from django.forms.fields import Field, CharField from django.forms.fields import Field, CharField
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
from django.utils.encoding import force_text from django.utils.encoding import force_text
from django.utils._os import upath from django.utils._os import upath
from django.utils import translation from django.utils import translation

View File

@ -5,7 +5,7 @@ from django.contrib.auth.models import User, Group
from django.contrib.auth.tests.custom_user import CustomUser from django.contrib.auth.tests.custom_user import CustomUser
from django.contrib.auth.tests.utils import skipIfCustomUser from django.contrib.auth.tests.utils import skipIfCustomUser
from django.test import TransactionTestCase from django.test import TransactionTestCase
from django.test.utils import override_settings from django.test import override_settings
# This must be a TransactionTestCase because the WSGI auth handler performs # This must be a TransactionTestCase because the WSGI auth handler performs

View File

@ -13,8 +13,7 @@ from django.core import exceptions
from django.core.management import call_command from django.core.management import call_command
from django.core.management.base import CommandError from django.core.management.base import CommandError
from django.core.management.validation import get_validation_errors from django.core.management.validation import get_validation_errors
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
from django.utils import six from django.utils import six
from django.utils.six import StringIO from django.utils.six import StringIO

View File

@ -3,8 +3,7 @@ from django.contrib.auth.models import AbstractUser, Group, User, UserManager
from django.contrib.auth.tests.utils import skipIfCustomUser from django.contrib.auth.tests.utils import skipIfCustomUser
from django.core import mail from django.core import mail
from django.db.models.signals import post_save from django.db.models.signals import post_save
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
@skipIfCustomUser @skipIfCustomUser

View File

@ -3,7 +3,7 @@ from django.contrib.auth.models import User
from django.contrib.auth.tests.utils import skipIfCustomUser from django.contrib.auth.tests.utils import skipIfCustomUser
from django.test import TestCase from django.test import TestCase
from django.test.client import RequestFactory from django.test.client import RequestFactory
from django.test.utils import override_settings from django.test import override_settings
@skipIfCustomUser @skipIfCustomUser

View File

@ -7,7 +7,7 @@ from django.contrib.auth.views import (
password_reset_complete, password_change, password_change_done, password_reset_complete, password_change, password_change_done,
) )
from django.test import RequestFactory, TestCase from django.test import RequestFactory, TestCase
from django.test.utils import override_settings from django.test import override_settings
from django.utils.encoding import force_bytes, force_text from django.utils.encoding import force_bytes, force_text
from django.utils.http import urlsafe_base64_encode from django.utils.http import urlsafe_base64_encode

View File

@ -14,8 +14,8 @@ from django.utils.encoding import force_text
from django.utils.http import urlquote from django.utils.http import urlquote
from django.utils.six.moves.urllib.parse import urlparse, ParseResult from django.utils.six.moves.urllib.parse import urlparse, ParseResult
from django.utils._os import upath from django.utils._os import upath
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings, patch_logger from django.test.utils import patch_logger
from django.middleware.csrf import CsrfViewMiddleware from django.middleware.csrf import CsrfViewMiddleware
from django.contrib.sessions.middleware import SessionMiddleware from django.contrib.sessions.middleware import SessionMiddleware

View File

@ -5,8 +5,7 @@ from django.contrib.contenttypes.views import shortcut
from django.contrib.sites.models import get_current_site from django.contrib.sites.models import get_current_site
from django.db import models from django.db import models
from django.http import HttpRequest, Http404 from django.http import HttpRequest, Http404
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
from django.utils.http import urlquote from django.utils.http import urlquote
from django.utils import six from django.utils import six
from django.utils.encoding import python_2_unicode_compatible from django.utils.encoding import python_2_unicode_compatible

View File

@ -2,7 +2,7 @@ import os
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.contrib.auth.tests.utils import skipIfCustomUser from django.contrib.auth.tests.utils import skipIfCustomUser
from django.test import TestCase, Client from django.test import TestCase, Client
from django.test.utils import override_settings from django.test import override_settings
@override_settings( @override_settings(

View File

@ -3,8 +3,7 @@ from __future__ import unicode_literals
from django.conf import settings from django.conf import settings
from django.contrib.flatpages.forms import FlatpageForm from django.contrib.flatpages.forms import FlatpageForm
from django.contrib.flatpages.models import FlatPage from django.contrib.flatpages.models import FlatPage
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
from django.utils import translation from django.utils import translation

View File

@ -3,8 +3,7 @@ from django.conf import settings
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.contrib.auth.tests.utils import skipIfCustomUser from django.contrib.auth.tests.utils import skipIfCustomUser
from django.contrib.flatpages.models import FlatPage from django.contrib.flatpages.models import FlatPage
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
@override_settings( @override_settings(

View File

@ -2,8 +2,7 @@ import os
from django.contrib.auth.models import AnonymousUser, User from django.contrib.auth.models import AnonymousUser, User
from django.contrib.auth.tests.utils import skipIfCustomUser from django.contrib.auth.tests.utils import skipIfCustomUser
from django.template import Template, Context, TemplateSyntaxError from django.template import Template, Context, TemplateSyntaxError
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
@override_settings( @override_settings(

View File

@ -3,8 +3,7 @@ from django.conf import settings
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.contrib.auth.tests.utils import skipIfCustomUser from django.contrib.auth.tests.utils import skipIfCustomUser
from django.contrib.flatpages.models import FlatPage from django.contrib.flatpages.models import FlatPage
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
@override_settings( @override_settings(

View File

@ -8,8 +8,7 @@ import warnings
from django import http from django import http
from django.contrib.formtools import preview, utils from django.contrib.formtools import preview, utils
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
from django.utils._os import upath from django.utils._os import upath
from django.contrib.formtools.tests.forms import ( from django.contrib.formtools.tests.forms import (

View File

@ -4,8 +4,7 @@ from unittest import skipUnless
from django.contrib.gis.geos import HAS_GEOS from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
if HAS_GEOS and HAS_SPATIAL_DB: if HAS_GEOS and HAS_SPATIAL_DB:
from django.contrib.gis import admin from django.contrib.gis import admin

View File

@ -11,8 +11,8 @@ except ImportError:
from django.conf import settings from django.conf import settings
from django.contrib.humanize.templatetags import humanize from django.contrib.humanize.templatetags import humanize
from django.template import Template, Context, defaultfilters from django.template import Template, Context, defaultfilters
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings, TransRealMixin from django.test.utils import TransRealMixin
from django.utils.html import escape from django.utils.html import escape
from django.utils.timezone import utc, get_fixed_timezone from django.utils.timezone import utc, get_fixed_timezone
from django.utils import translation from django.utils import translation

View File

@ -9,7 +9,7 @@ from django.contrib.messages.constants import DEFAULT_LEVELS
from django.contrib.messages.storage import default_storage, base from django.contrib.messages.storage import default_storage, base
from django.contrib.messages.storage.base import Message from django.contrib.messages.storage.base import Message
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.test.utils import modify_settings, override_settings from django.test import modify_settings, override_settings
from django.utils.translation import ugettext_lazy from django.utils.translation import ugettext_lazy

View File

@ -5,8 +5,7 @@ from django.contrib.messages.tests.base import BaseTests
from django.contrib.messages.storage.cookie import (CookieStorage, from django.contrib.messages.storage.cookie import (CookieStorage,
MessageEncoder, MessageDecoder) MessageEncoder, MessageDecoder)
from django.contrib.messages.storage.base import Message from django.contrib.messages.storage.base import Message
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
from django.utils.safestring import SafeData, mark_safe from django.utils.safestring import SafeData, mark_safe

View File

@ -2,8 +2,7 @@ from django import http
from django.conf import settings from django.conf import settings
from django.contrib.sites.models import Site from django.contrib.sites.models import Site
from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase from django.test import TestCase, modify_settings, override_settings
from django.test.utils import modify_settings, override_settings
from django.utils import six from django.utils import six
from .middleware import RedirectFallbackMiddleware from .middleware import RedirectFallbackMiddleware

View File

@ -20,8 +20,8 @@ from django.core.cache.backends.base import InvalidCacheBackendError
from django.core import management from django.core import management
from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ImproperlyConfigured
from django.http import HttpResponse from django.http import HttpResponse
from django.test import TestCase, RequestFactory from django.test import TestCase, RequestFactory, override_settings
from django.test.utils import override_settings, patch_logger from django.test.utils import patch_logger
from django.utils import six from django.utils import six
from django.utils import timezone from django.utils import timezone

View File

@ -1,6 +1,6 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from django.test.utils import override_settings from django.test import override_settings
from .base import TestModel, SitemapTestsBase from .base import TestModel, SitemapTestsBase

View File

@ -2,7 +2,7 @@ from __future__ import unicode_literals
from datetime import date from datetime import date
from django.test.utils import override_settings from django.test import override_settings
from .base import SitemapTestsBase from .base import SitemapTestsBase

View File

@ -4,8 +4,7 @@ from django.conf import settings
from django.contrib.sites.models import Site, RequestSite, get_current_site from django.contrib.sites.models import Site, RequestSite, get_current_site
from django.core.exceptions import ObjectDoesNotExist, ValidationError from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.http import HttpRequest from django.http import HttpRequest
from django.test import TestCase from django.test import TestCase, modify_settings, override_settings
from django.test.utils import modify_settings, override_settings
@modify_settings(INSTALLED_APPS={'append': 'django.contrib.sites'}) @modify_settings(INSTALLED_APPS={'append': 'django.contrib.sites'})

View File

@ -3,8 +3,7 @@ from __future__ import unicode_literals
from django.contrib.admin.utils import quote from django.contrib.admin.utils import quote
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.template.response import TemplateResponse from django.template.response import TemplateResponse
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
from .models import Action, Person, Car from .models import Action, Person, Car

View File

@ -5,8 +5,7 @@ from django.contrib.sites.models import Site
from django.contrib.admindocs import utils from django.contrib.admindocs import utils
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.test import TestCase from django.test import TestCase, modify_settings, override_settings
from django.test.utils import modify_settings, override_settings
class MiscTests(TestCase): class MiscTests(TestCase):

View File

@ -8,9 +8,9 @@ from django.contrib.admin.views.main import ChangeList
from django.contrib.auth.admin import UserAdmin from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase, RequestFactory from django.test import TestCase, RequestFactory, override_settings
from django.test.utils import override_settings, six
from django.utils.encoding import force_text from django.utils.encoding import force_text
from django.utils import six
from .models import Book, Department, Employee from .models import Book, Department, Employee

View File

@ -4,8 +4,7 @@ from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase
from django.contrib.admin.helpers import InlineAdminForm from django.contrib.admin.helpers import InlineAdminForm
from django.contrib.auth.models import User, Permission from django.contrib.auth.models import User, Permission
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
# local test models # local test models
from .admin import InnerInline from .admin import InnerInline

View File

@ -29,7 +29,7 @@ from django.forms.utils import ErrorList
from django.template.response import TemplateResponse from django.template.response import TemplateResponse
from django.test import TestCase from django.test import TestCase
from django.test.utils import patch_logger from django.test.utils import patch_logger
from django.test.utils import override_settings from django.test import override_settings
from django.utils import formats from django.utils import formats
from django.utils import translation from django.utils import translation
from django.utils.cache import get_max_age from django.utils.cache import get_max_age

View File

@ -18,7 +18,7 @@ from django.core.files.storage import default_storage
from django.core.files.uploadedfile import SimpleUploadedFile from django.core.files.uploadedfile import SimpleUploadedFile
from django.db.models import CharField, DateField from django.db.models import CharField, DateField
from django.test import TestCase as DjangoTestCase from django.test import TestCase as DjangoTestCase
from django.test.utils import override_settings from django.test import override_settings
from django.utils import six from django.utils import six
from django.utils import translation from django.utils import translation

View File

@ -20,9 +20,9 @@ from django.db.models import Sum, Avg, Variance, StdDev
from django.db.models.fields import (AutoField, DateField, DateTimeField, from django.db.models.fields import (AutoField, DateField, DateTimeField,
DecimalField, IntegerField, TimeField) DecimalField, IntegerField, TimeField)
from django.db.utils import ConnectionHandler from django.db.utils import ConnectionHandler
from django.test import (TestCase, skipUnlessDBFeature, skipIfDBFeature, from django.test import (TestCase, TransactionTestCase, override_settings,
TransactionTestCase) skipUnlessDBFeature, skipIfDBFeature)
from django.test.utils import override_settings, str_prefix from django.test.utils import str_prefix
from django.utils import six from django.utils import six
from django.utils.six.moves import xrange from django.utils.six.moves import xrange

View File

@ -4,7 +4,7 @@ from operator import attrgetter
from django.db import connection from django.db import connection
from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature
from django.test.utils import override_settings from django.test import override_settings
from .models import Country, Restaurant, Pizzeria, State, TwoFields from .models import Country, Restaurant, Pizzeria, State, TwoFields

View File

@ -23,8 +23,8 @@ from django.middleware.cache import (FetchFromCacheMiddleware,
UpdateCacheMiddleware, CacheMiddleware) UpdateCacheMiddleware, CacheMiddleware)
from django.template import Template from django.template import Template
from django.template.response import TemplateResponse from django.template.response import TemplateResponse
from django.test import TestCase, TransactionTestCase, RequestFactory from django.test import TestCase, TransactionTestCase, RequestFactory, override_settings
from django.test.utils import (override_settings, IgnoreDeprecationWarningsMixin, from django.test.utils import (IgnoreDeprecationWarningsMixin,
IgnorePendingDeprecationWarningsMixin) IgnorePendingDeprecationWarningsMixin)
from django.utils import six from django.utils import six
from django.utils import timezone from django.utils import timezone

View File

@ -3,8 +3,7 @@ from django.contrib.comments.forms import CommentForm
from django.contrib.comments.models import Comment from django.contrib.comments.models import Comment
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site from django.contrib.sites.models import Site
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
from ..models import Article, Author from ..models import Article, Author

View File

@ -3,7 +3,7 @@ import time
from django.conf import settings from django.conf import settings
from django.contrib.comments.forms import CommentForm from django.contrib.comments.forms import CommentForm
from django.contrib.comments.models import Comment from django.contrib.comments.models import Comment
from django.test.utils import override_settings from django.test import override_settings
from . import CommentTestCase from . import CommentTestCase
from ..models import Article from ..models import Article

View File

@ -2,7 +2,7 @@ from django.contrib.comments.models import Comment
from django.contrib.comments.moderation import (moderator, CommentModerator, from django.contrib.comments.moderation import (moderator, CommentModerator,
AlreadyModerated) AlreadyModerated)
from django.core import mail from django.core import mail
from django.test.utils import override_settings from django.test import override_settings
from . import CommentTestCase from . import CommentTestCase
from ..models import Entry from ..models import Entry

View File

@ -7,8 +7,7 @@ from django.core.context_processors import csrf
from django.http import HttpRequest, HttpResponse from django.http import HttpRequest, HttpResponse
from django.middleware.csrf import CsrfViewMiddleware, CSRF_KEY_LENGTH from django.middleware.csrf import CsrfViewMiddleware, CSRF_KEY_LENGTH
from django.template import RequestContext, Template from django.template import RequestContext, Template
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
from django.views.decorators.csrf import csrf_exempt, requires_csrf_token, ensure_csrf_cookie from django.views.decorators.csrf import csrf_exempt, requires_csrf_token, ensure_csrf_cookie

View File

@ -6,8 +6,7 @@ from django.apps import app_cache
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from django.contrib.sessions.backends.db import SessionStore from django.contrib.sessions.backends.db import SessionStore
from django.db.models import Count from django.db.models import Count
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
from .models import ( from .models import (
ResolveThis, Item, RelatedItem, Child, Leaf, Proxy, SimpleItem, Feature, ResolveThis, Item, RelatedItem, Child, Leaf, Proxy, SimpleItem, Feature,

View File

@ -21,7 +21,7 @@ from django.core.files.base import File, ContentFile
from django.core.files.storage import FileSystemStorage, get_storage_class from django.core.files.storage import FileSystemStorage, get_storage_class
from django.core.files.uploadedfile import SimpleUploadedFile from django.core.files.uploadedfile import SimpleUploadedFile
from django.test import LiveServerTestCase, SimpleTestCase from django.test import LiveServerTestCase, SimpleTestCase
from django.test.utils import override_settings from django.test import override_settings
from django.utils import six from django.utils import six
from django.utils.six.moves.urllib.request import urlopen from django.utils.six.moves.urllib.request import urlopen
from django.utils._os import upath from django.utils._os import upath

View File

@ -14,7 +14,7 @@ from django.core.files import temp as tempfile
from django.core.files.uploadedfile import SimpleUploadedFile from django.core.files.uploadedfile import SimpleUploadedFile
from django.http.multipartparser import MultiPartParser from django.http.multipartparser import MultiPartParser
from django.test import TestCase, client from django.test import TestCase, client
from django.test.utils import override_settings from django.test import override_settings
from django.utils.encoding import force_bytes from django.utils.encoding import force_bytes
from django.utils.six import StringIO from django.utils.six import StringIO

View File

@ -15,7 +15,7 @@ from django.db import transaction, IntegrityError
from django.db.models import signals from django.db.models import signals
from django.test import (TestCase, TransactionTestCase, skipIfDBFeature, from django.test import (TestCase, TransactionTestCase, skipIfDBFeature,
skipUnlessDBFeature) skipUnlessDBFeature)
from django.test.utils import override_settings from django.test import override_settings
from django.utils.encoding import force_text from django.utils.encoding import force_text
from django.utils._os import upath from django.utils._os import upath
from django.utils import six from django.utils import six

View File

@ -12,8 +12,7 @@ from django.forms import (
) )
from django.forms.extras import SelectDateWidget from django.forms.extras import SelectDateWidget
from django.forms.utils import ErrorList from django.forms.utils import ErrorList
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
from django.utils import six from django.utils import six
from django.utils import translation from django.utils import translation
from django.utils.dates import MONTHS_AP from django.utils.dates import MONTHS_AP

View File

@ -1,7 +1,7 @@
from datetime import time, date, datetime from datetime import time, date, datetime
from django import forms from django import forms
from django.test.utils import override_settings from django.test import override_settings
from django.utils.translation import activate, deactivate from django.utils.translation import activate, deactivate
from django.test import SimpleTestCase from django.test import SimpleTestCase

View File

@ -1,8 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.forms import Media, TextInput, CharField, Form, MultiWidget from django.forms import Media, TextInput, CharField, Form, MultiWidget
from django.template import Template, Context from django.template import Template, Context
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
@override_settings( @override_settings(

View File

@ -18,8 +18,7 @@ from django.forms.widgets import RadioFieldRenderer
from django.utils.safestring import mark_safe from django.utils.safestring import mark_safe
from django.utils import six from django.utils import six
from django.utils.translation import activate, deactivate, override from django.utils.translation import activate, deactivate, override
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
from django.utils.encoding import python_2_unicode_compatible, force_text from django.utils.encoding import python_2_unicode_compatible, force_text
from ..models import Article from ..models import Article

View File

@ -8,8 +8,7 @@ from django.contrib.contenttypes.generic import (
generic_inlineformset_factory, GenericTabularInline) generic_inlineformset_factory, GenericTabularInline)
from django.forms.formsets import DEFAULT_MAX_NUM from django.forms.formsets import DEFAULT_MAX_NUM
from django.forms.models import ModelForm from django.forms.models import ModelForm
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
# local test models # local test models
from .admin import MediaInline, MediaPermanentInline from .admin import MediaInline, MediaPermanentInline

View File

@ -3,8 +3,8 @@ from __future__ import unicode_literals
import datetime import datetime
from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase, skipUnlessDBFeature from django.test import TestCase, override_settings, skipUnlessDBFeature
from django.test.utils import override_settings, requires_tz_support from django.test.utils import requires_tz_support
from django.utils import timezone from django.utils import timezone
from .models import Book, BookSigning from .models import Book, BookSigning

View File

@ -1,8 +1,7 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
from django.views.generic.base import View from django.views.generic.base import View
from django.utils.encoding import force_str from django.utils.encoding import force_str

View File

@ -6,7 +6,7 @@ from django.core.handlers.wsgi import WSGIHandler, WSGIRequest
from django.core.signals import request_started, request_finished from django.core.signals import request_started, request_finished
from django.db import close_old_connections, connection from django.db import close_old_connections, connection
from django.test import RequestFactory, TestCase, TransactionTestCase from django.test import RequestFactory, TestCase, TransactionTestCase
from django.test.utils import override_settings from django.test import override_settings
from django.utils.encoding import force_str from django.utils.encoding import force_str
from django.utils import six from django.utils import six

View File

@ -4,8 +4,8 @@ from __future__ import unicode_literals
import os import os
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings, TransRealMixin from django.test.utils import TransRealMixin
from django.utils._os import upath from django.utils._os import upath
from django.utils import six from django.utils import six
from django.utils import translation from django.utils import translation

View File

@ -6,8 +6,7 @@ from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse, clear_url_caches from django.core.urlresolvers import reverse, clear_url_caches
from django.http import HttpResponsePermanentRedirect from django.http import HttpResponsePermanentRedirect
from django.middleware.locale import LocaleMiddleware from django.middleware.locale import LocaleMiddleware
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
from django.template import Template, Context from django.template import Template, Context
from django.utils._os import upath from django.utils._os import upath
from django.utils import translation from django.utils import translation

View File

@ -4,7 +4,7 @@ import unittest
from django.core.management import call_command, CommandError from django.core.management import call_command, CommandError
from django.core.management.utils import find_command from django.core.management.utils import find_command
from django.test import SimpleTestCase from django.test import SimpleTestCase
from django.test.utils import override_settings from django.test import override_settings
from django.utils import translation from django.utils import translation
from django.utils._os import upath from django.utils._os import upath
from django.utils.six import StringIO from django.utils.six import StringIO

View File

@ -12,7 +12,7 @@ from django.conf import settings
from django.core import management from django.core import management
from django.core.management.utils import find_command from django.core.management.utils import find_command
from django.test import SimpleTestCase from django.test import SimpleTestCase
from django.test.utils import override_settings from django.test import override_settings
from django.utils.encoding import force_text from django.utils.encoding import force_text
from django.utils._os import upath from django.utils._os import upath
from django.utils import six from django.utils import six

View File

@ -11,8 +11,8 @@ from threading import local
from django.conf import settings from django.conf import settings
from django.template import Template, Context from django.template import Template, Context
from django.template.base import TemplateSyntaxError from django.template.base import TemplateSyntaxError
from django.test import TestCase, RequestFactory from django.test import TestCase, RequestFactory, override_settings
from django.test.utils import override_settings, TransRealMixin from django.test.utils import TransRealMixin
from django.utils import translation from django.utils import translation
from django.utils.formats import (get_format, date_format, time_format, from django.utils.formats import (get_format, date_format, time_format,
localize, localize_input, iter_format_modules, get_format_modules, localize, localize_input, iter_format_modules, get_format_modules,

View File

@ -1,8 +1,7 @@
from django.core.management.color import no_style from django.core.management.color import no_style
from django.core.management.sql import custom_sql_for_model from django.core.management.sql import custom_sql_for_model
from django.db import connections, DEFAULT_DB_ALIAS from django.db import connections, DEFAULT_DB_ALIAS
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
from .models import Simple from .models import Simple

View File

@ -5,8 +5,8 @@ import warnings
from django.conf import LazySettings from django.conf import LazySettings
from django.core import mail from django.core import mail
from django.test import TestCase, RequestFactory from django.test import TestCase, RequestFactory, override_settings
from django.test.utils import override_settings, patch_logger from django.test.utils import patch_logger
from django.utils.encoding import force_text from django.utils.encoding import force_text
from django.utils.log import (CallbackFilter, RequireDebugFalse, from django.utils.log import (CallbackFilter, RequireDebugFalse,
RequireDebugTrue) RequireDebugTrue)

View File

@ -19,7 +19,7 @@ from django.core.mail import (EmailMessage, mail_admins, mail_managers,
from django.core.mail.backends import console, dummy, locmem, filebased, smtp from django.core.mail.backends import console, dummy, locmem, filebased, smtp
from django.core.mail.message import BadHeaderError from django.core.mail.message import BadHeaderError
from django.test import SimpleTestCase from django.test import SimpleTestCase
from django.test.utils import override_settings from django.test import override_settings
from django.utils.encoding import force_str, force_text from django.utils.encoding import force_str, force_text
from django.utils.six import PY3, StringIO, string_types from django.utils.six import PY3, StringIO, string_types
from django.utils.translation import ugettext_lazy from django.utils.translation import ugettext_lazy

View File

@ -3,8 +3,7 @@ from __future__ import unicode_literals
from django.apps import app_cache from django.apps import app_cache
from django.db import models from django.db import models
from django.template import Context, Template from django.template import Context, Template
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
from django.utils.encoding import force_text from django.utils.encoding import force_text
from .models import ( from .models import (

View File

@ -18,8 +18,8 @@ from django.middleware.common import CommonMiddleware, BrokenLinkEmailsMiddlewar
from django.middleware.http import ConditionalGetMiddleware from django.middleware.http import ConditionalGetMiddleware
from django.middleware.gzip import GZipMiddleware from django.middleware.gzip import GZipMiddleware
from django.middleware.transaction import TransactionMiddleware from django.middleware.transaction import TransactionMiddleware
from django.test import TransactionTestCase, TestCase, RequestFactory from django.test import TransactionTestCase, TestCase, RequestFactory, override_settings
from django.test.utils import override_settings, IgnoreDeprecationWarningsMixin from django.test.utils import IgnoreDeprecationWarningsMixin
from django.utils import six from django.utils import six
from django.utils.encoding import force_str from django.utils.encoding import force_str
from django.utils.six.moves import xrange from django.utils.six.moves import xrange

View File

@ -5,8 +5,7 @@ from django.core.signals import got_request_exception
from django.http import HttpResponse from django.http import HttpResponse
from django.template.response import TemplateResponse from django.template.response import TemplateResponse
from django.template import Template from django.template import Template
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
class TestException(Exception): class TestException(Exception):

View File

@ -7,7 +7,7 @@ import shutil
from django.apps import app_cache from django.apps import app_cache
from django.core.management import call_command, CommandError from django.core.management import call_command, CommandError
from django.test.utils import override_settings from django.test import override_settings
from django.utils import six from django.utils import six
from django.utils._os import upath from django.utils._os import upath
from django.utils.encoding import force_text from django.utils.encoding import force_text

View File

@ -1,6 +1,7 @@
from django.test.utils import override_settings
from django.db import connection from django.db import connection
from django.db.migrations.executor import MigrationExecutor from django.db.migrations.executor import MigrationExecutor
from django.test import override_settings
from .test_base import MigrationTestBase from .test_base import MigrationTestBase

View File

@ -1,7 +1,6 @@
from unittest import skipIf from unittest import skipIf
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
from django.db import connection from django.db import connection
from django.db.migrations.loader import MigrationLoader, AmbiguityError from django.db.migrations.loader import MigrationLoader, AmbiguityError
from django.db.migrations.recorder import MigrationRecorder from django.db.migrations.recorder import MigrationRecorder

View File

@ -13,8 +13,8 @@ from django.contrib.admin import (SimpleListFilter,
from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ImproperlyConfigured
from django.forms.models import BaseModelFormSet from django.forms.models import BaseModelFormSet
from django.forms.widgets import Select from django.forms.widgets import Select
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import str_prefix, override_settings from django.test.utils import str_prefix
from django.utils import six from django.utils import six
from .models import Band, Concert, ValidationTestModel, ValidationTestInlineModel from .models import Band, Concert, ValidationTestModel, ValidationTestInlineModel

View File

@ -10,8 +10,7 @@ from django.core import management
from django.db import connections, router, DEFAULT_DB_ALIAS, transaction from django.db import connections, router, DEFAULT_DB_ALIAS, transaction
from django.db.models import signals from django.db.models import signals
from django.db.utils import ConnectionRouter from django.db.utils import ConnectionRouter
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
from django.utils.six import StringIO from django.utils.six import StringIO
from .models import Book, Person, Pet, Review, UserProfile from .models import Book, Person, Pet, Review, UserProfile

View File

@ -3,8 +3,7 @@ from __future__ import unicode_literals
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from django.db import connection from django.db import connection
from django.db.models import Prefetch from django.db.models import Prefetch
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
from django.utils import six from django.utils import six
from .models import (Author, Book, Reader, Qualification, Teacher, Department, from .models import (Author, Book, Reader, Qualification, Teacher, Department,

View File

@ -7,8 +7,7 @@ from django.core import management
from django.core.exceptions import FieldError from django.core.exceptions import FieldError
from django.db import models, DEFAULT_DB_ALIAS from django.db import models, DEFAULT_DB_ALIAS
from django.db.models import signals from django.db.models import signals
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
from .models import (MyPerson, Person, StatusPerson, LowerStatusPerson, from .models import (MyPerson, Person, StatusPerson, LowerStatusPerson,

View File

@ -13,9 +13,9 @@ from django.core.exceptions import SuspiciousOperation
from django.core.handlers.wsgi import WSGIRequest, LimitedStream from django.core.handlers.wsgi import WSGIRequest, LimitedStream
from django.http import (HttpRequest, HttpResponse, parse_cookie, from django.http import (HttpRequest, HttpResponse, parse_cookie,
build_request_repr, UnreadablePostError, RawPostDataException) build_request_repr, UnreadablePostError, RawPostDataException)
from django.test import SimpleTestCase, TransactionTestCase from django.test import SimpleTestCase, TransactionTestCase, override_settings
from django.test.client import FakePayload from django.test.client import FakePayload
from django.test.utils import override_settings, str_prefix from django.test.utils import str_prefix
from django.utils import six from django.utils import six
from django.utils.http import cookie_date, urlencode from django.utils.http import cookie_date, urlencode
from django.utils.six.moves.urllib.parse import urlencode as original_urlencode from django.utils.six.moves.urllib.parse import urlencode as original_urlencode

View File

@ -8,7 +8,7 @@ from django.db import transaction, connection, router
from django.db.utils import ConnectionHandler, DEFAULT_DB_ALIAS, DatabaseError from django.db.utils import ConnectionHandler, DEFAULT_DB_ALIAS, DatabaseError
from django.test import (TransactionTestCase, skipIfDBFeature, from django.test import (TransactionTestCase, skipIfDBFeature,
skipUnlessDBFeature) skipUnlessDBFeature)
from django.test.utils import override_settings from django.test import override_settings
from multiple_database.routers import TestRouter from multiple_database.routers import TestRouter

View File

@ -16,8 +16,8 @@ except ImportError:
from django.core import management, serializers from django.core import management, serializers
from django.db import transaction, connection from django.db import transaction, connection
from django.test import TestCase, TransactionTestCase from django.test import TestCase, TransactionTestCase, override_settings
from django.test.utils import Approximate, override_settings from django.test.utils import Approximate
from django.utils import six from django.utils import six
from django.utils.six import StringIO from django.utils.six import StringIO

View File

@ -9,7 +9,7 @@ import socket
from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ImproperlyConfigured
from django.test import LiveServerTestCase from django.test import LiveServerTestCase
from django.test.utils import override_settings from django.test import override_settings
from django.utils.http import urlencode from django.utils.http import urlencode
from django.utils.six.moves.urllib.error import HTTPError from django.utils.six.moves.urllib.error import HTTPError
from django.utils.six.moves.urllib.request import urlopen from django.utils.six.moves.urllib.request import urlopen

View File

@ -5,8 +5,8 @@ import warnings
from django.conf import settings from django.conf import settings
from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ImproperlyConfigured
from django.http import HttpRequest from django.http import HttpRequest
from django.test import SimpleTestCase, TransactionTestCase, TestCase, signals from django.test import (SimpleTestCase, TransactionTestCase, TestCase,
from django.test.utils import modify_settings, override_settings modify_settings, override_settings, signals)
from django.utils import six from django.utils import six

View File

@ -7,7 +7,7 @@ django.test.LiveServerTestCase.
import os import os
from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ImproperlyConfigured
from django.test.utils import override_settings from django.test import override_settings
from django.utils.six.moves.urllib.request import urlopen from django.utils.six.moves.urllib.request import urlopen
from django.utils._os import upath from django.utils._os import upath

View File

@ -14,8 +14,7 @@ from django.conf import settings
from django.core.cache.backends.base import BaseCache from django.core.cache.backends.base import BaseCache
from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ImproperlyConfigured
from django.core.management import call_command from django.core.management import call_command
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
from django.utils.encoding import force_text from django.utils.encoding import force_text
from django.utils.functional import empty from django.utils.functional import empty
from django.utils._os import rmtree_errorhandler, upath from django.utils._os import rmtree_errorhandler, upath

View File

@ -6,8 +6,7 @@ from django.apps import app_cache
from django.contrib.auth.models import Permission from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from django.core import management from django.core import management
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
from swappable_models.models import Article from swappable_models.models import Article

View File

@ -2,7 +2,7 @@ from unittest import TestCase
from django.template import VariableNode, Context from django.template import VariableNode, Context
from django.template.loader import get_template_from_string from django.template.loader import get_template_from_string
from django.test.utils import override_settings from django.test import override_settings
class NodelistTest(TestCase): class NodelistTest(TestCase):

View File

@ -7,7 +7,7 @@ from unittest import TestCase
from django.template import (TokenParser, FilterExpression, Parser, Variable, from django.template import (TokenParser, FilterExpression, Parser, Variable,
Template, TemplateSyntaxError, Library) Template, TemplateSyntaxError, Library)
from django.test.utils import override_settings from django.test import override_settings
from django.utils import six from django.utils import six

View File

@ -10,7 +10,7 @@ from django.conf import settings
from django.template import Template, Context from django.template import Template, Context
from django.template.response import (TemplateResponse, SimpleTemplateResponse, from django.template.response import (TemplateResponse, SimpleTemplateResponse,
ContentNotRenderedError) ContentNotRenderedError)
from django.test.utils import override_settings from django.test import override_settings
from django.utils._os import upath from django.utils._os import upath

View File

@ -24,7 +24,7 @@ from __future__ import unicode_literals
from django.core import mail from django.core import mail
from django.test import Client, TestCase, RequestFactory from django.test import Client, TestCase, RequestFactory
from django.test.utils import override_settings from django.test import override_settings
from .views import get_view from .views import get_view

View File

@ -12,9 +12,9 @@ from django.core.urlresolvers import reverse
from django.template import (TemplateSyntaxError, from django.template import (TemplateSyntaxError,
Context, Template, loader) Context, Template, loader)
import django.template.context import django.template.context
from django.test import Client, TestCase from django.test import Client, TestCase, override_settings
from django.test.client import encode_file, RequestFactory from django.test.client import encode_file, RequestFactory
from django.test.utils import ContextList, override_settings, str_prefix from django.test.utils import ContextList, str_prefix
from django.template.response import SimpleTemplateResponse from django.template.response import SimpleTemplateResponse
from django.utils._os import upath from django.utils._os import upath
from django.utils.translation import ugettext_lazy from django.utils.translation import ugettext_lazy

View File

@ -17,8 +17,8 @@ from django.core.urlresolvers import reverse
from django.db.models import Min, Max from django.db.models import Min, Max
from django.http import HttpRequest from django.http import HttpRequest
from django.template import Context, RequestContext, Template, TemplateSyntaxError from django.template import Context, RequestContext, Template, TemplateSyntaxError
from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature from django.test import TestCase, override_settings, skipIfDBFeature, skipUnlessDBFeature
from django.test.utils import override_settings, requires_tz_support from django.test.utils import requires_tz_support
from django.utils import six from django.utils import six
from django.utils import timezone from django.utils import timezone

View File

@ -5,8 +5,8 @@ from unittest import skipIf, skipUnless, SkipTest
from django.db import (connection, connections, transaction, DEFAULT_DB_ALIAS, DatabaseError, from django.db import (connection, connections, transaction, DEFAULT_DB_ALIAS, DatabaseError,
IntegrityError) IntegrityError)
from django.db.transaction import commit_on_success, commit_manually, TransactionManagementError from django.db.transaction import commit_on_success, commit_manually, TransactionManagementError
from django.test import TransactionTestCase, skipUnlessDBFeature from django.test import TransactionTestCase, override_settings, skipUnlessDBFeature
from django.test.utils import override_settings, IgnoreDeprecationWarningsMixin from django.test.utils import IgnoreDeprecationWarningsMixin
from .models import Mod, M2mA, M2mB, SubMod from .models import Mod, M2mA, M2mB, SubMod

View File

@ -12,8 +12,7 @@ from django.core.urlresolvers import (reverse, reverse_lazy, resolve, get_callab
RegexURLPattern) RegexURLPattern)
from django.http import HttpRequest, HttpResponseRedirect, HttpResponsePermanentRedirect from django.http import HttpRequest, HttpResponseRedirect, HttpResponsePermanentRedirect
from django.shortcuts import redirect from django.shortcuts import redirect
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
from django.utils import six from django.utils import six
from . import urlconf_outer, middleware, views from . import urlconf_outer, middleware, views

View File

@ -3,8 +3,7 @@ from __future__ import unicode_literals
from datetime import datetime, date from datetime import datetime, date
import time import time
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
from django.utils.dateformat import format from django.utils.dateformat import format
from django.utils import dateformat from django.utils import dateformat
from django.utils.timezone import utc, get_fixed_timezone, get_default_timezone, make_aware from django.utils.timezone import utc, get_fixed_timezone, get_default_timezone, make_aware

View File

@ -3,7 +3,7 @@ import datetime
import pickle import pickle
import unittest import unittest
from django.test.utils import override_settings from django.test import override_settings
from django.utils import timezone from django.utils import timezone

View File

@ -16,9 +16,9 @@ from django.core import mail
from django.core.files.uploadedfile import SimpleUploadedFile from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.template.base import TemplateDoesNotExist from django.template.base import TemplateDoesNotExist
from django.test import TestCase, RequestFactory from django.test import TestCase, RequestFactory, override_settings
from django.test.utils import (override_settings, setup_test_template_loader, from django.test.utils import (
restore_template_loaders) setup_test_template_loader, restore_template_loaders)
from django.utils.encoding import force_text, force_bytes from django.utils.encoding import force_text, force_bytes
from django.utils import six from django.utils import six
from django.views.debug import ExceptionReporter from django.views.debug import ExceptionReporter

View File

@ -1,5 +1,4 @@
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.utils import override_settings
@override_settings( @override_settings(

View File

@ -6,8 +6,7 @@ import unittest
from django.conf.urls.static import static from django.conf.urls.static import static
from django.http import HttpResponseNotModified from django.http import HttpResponseNotModified
from django.test import SimpleTestCase from django.test import SimpleTestCase, override_settings
from django.test.utils import override_settings
from django.utils.http import http_date from django.utils.http import http_date
from django.views.static import was_modified_since from django.views.static import was_modified_since

View File

@ -7,9 +7,8 @@ from django.core.servers.basehttp import get_internal_wsgi_application
from django.core.signals import request_started from django.core.signals import request_started
from django.core.wsgi import get_wsgi_application from django.core.wsgi import get_wsgi_application
from django.db import close_old_connections from django.db import close_old_connections
from django.test import TestCase from django.test import TestCase, override_settings
from django.test.client import RequestFactory from django.test.client import RequestFactory
from django.test.utils import override_settings
from django.utils import six from django.utils import six