summaryrefslogtreecommitdiff
path: root/tests/cache
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-02-09 13:19:34 -0500
committerTim Graham <timograham@gmail.com>2015-02-09 14:24:06 -0500
commita8b70d251d238b4e6cfc7bb4296da15494f8dff3 (patch)
tree94ef5bc53e59131906aecfcf792eeac86242aa62 /tests/cache
parenteb406aa686ff1809903366ef6896037af2f1f69b (diff)
[1.8.x] Sorted imports with isort; refs #23860.
Backport of 0ed7d155635da9f79d4dd67e4889087d3673c6da from master
Diffstat (limited to 'tests/cache')
-rw-r--r--tests/cache/models.py3
-rw-r--r--tests/cache/tests.py39
2 files changed, 22 insertions, 20 deletions
diff --git a/tests/cache/models.py b/tests/cache/models.py
index 4fccbb664b..349fd87473 100644
--- a/tests/cache/models.py
+++ b/tests/cache/models.py
@@ -1,6 +1,5 @@
-from django.utils import timezone
-
from django.db import models
+from django.utils import timezone
def expensive_calculation():
diff --git a/tests/cache/tests.py b/tests/cache/tests.py
index 3e2dc5c1a0..472c0fe3ed 100644
--- a/tests/cache/tests.py
+++ b/tests/cache/tests.py
@@ -4,9 +4,9 @@
# Uses whatever cache backend is set in the test settings file.
from __future__ import unicode_literals
+import copy
import os
import re
-import copy
import shutil
import tempfile
import threading
@@ -15,39 +15,42 @@ import unittest
import warnings
from django.conf import settings
-from django.core import management
-from django.core import signals
-from django.core.cache import (cache, caches, CacheKeyWarning,
- InvalidCacheBackendError, DEFAULT_CACHE_ALIAS, get_cache,
- close_caches)
-from django.db import connection, connections, transaction
+from django.core import management, signals
+from django.core.cache import (
+ DEFAULT_CACHE_ALIAS, CacheKeyWarning, InvalidCacheBackendError, cache,
+ caches, close_caches, get_cache,
+)
from django.core.cache.utils import make_template_fragment_key
+from django.db import connection, connections, transaction
from django.http import HttpRequest, HttpResponse, StreamingHttpResponse
-from django.middleware.cache import (FetchFromCacheMiddleware,
- UpdateCacheMiddleware, CacheMiddleware)
+from django.middleware.cache import (
+ CacheMiddleware, FetchFromCacheMiddleware, UpdateCacheMiddleware,
+)
from django.middleware.csrf import CsrfViewMiddleware
from django.template import engines
from django.template.context_processors import csrf
from django.template.response import TemplateResponse
-from django.test import (TestCase, TransactionTestCase, RequestFactory,
- ignore_warnings, override_settings)
+from django.test import (
+ RequestFactory, TestCase, TransactionTestCase, ignore_warnings,
+ override_settings,
+)
from django.test.signals import setting_changed
-from django.utils import six
-from django.utils import timezone
-from django.utils import translation
-from django.utils.cache import (patch_vary_headers, get_cache_key,
- learn_cache_key, patch_cache_control, patch_response_headers)
+from django.utils import six, timezone, translation
+from django.utils.cache import (
+ get_cache_key, learn_cache_key, patch_cache_control,
+ patch_response_headers, patch_vary_headers,
+)
from django.utils.deprecation import RemovedInDjango19Warning
from django.utils.encoding import force_text
from django.views.decorators.cache import cache_page
+from .models import Poll, expensive_calculation
+
try: # Use the same idiom as in cache backends
from django.utils.six.moves import cPickle as pickle
except ImportError:
import pickle
-from .models import Poll, expensive_calculation
-
# functions/classes for complex data type tests
def f():