|
3 | 3 |
|
4 | 4 | # Unit tests for cache framework
|
5 | 5 | # Uses whatever cache backend is set in the test settings file.
|
6 |
| -import copy |
7 |
| -import io |
8 | 6 | import os
|
9 | 7 | import pickle
|
10 |
| -import re |
11 | 8 | import shutil
|
12 |
| -import sys |
13 | 9 | import tempfile
|
14 |
| -import threading |
15 | 10 | import time
|
16 |
| -import unittest |
17 |
| -import warnings |
18 |
| -from pathlib import Path |
19 |
| -from unittest import mock, skipIf |
| 11 | +from unittest import mock |
20 | 12 |
|
21 | 13 | from django.conf import settings
|
22 |
| -from django.core import management, signals |
23 | 14 | from django.core.cache import (
|
24 |
| - DEFAULT_CACHE_ALIAS, |
25 | 15 | CacheKeyWarning,
|
26 |
| - InvalidCacheKey, |
27 | 16 | cache,
|
28 | 17 | caches,
|
29 | 18 | )
|
30 |
| -from django.core.cache.utils import make_template_fragment_key |
31 |
| -from django.db import close_old_connections, connection, connections |
32 |
| -from django.http import ( |
33 |
| - HttpRequest, |
34 |
| - HttpResponse, |
35 |
| - HttpResponseNotModified, |
36 |
| - StreamingHttpResponse, |
37 |
| -) |
| 19 | +from django.http import HttpResponse |
38 | 20 | from django.middleware.cache import (
|
39 |
| - CacheMiddleware, |
40 | 21 | FetchFromCacheMiddleware,
|
41 | 22 | UpdateCacheMiddleware,
|
42 | 23 | )
|
43 |
| -from django.middleware.csrf import CsrfViewMiddleware |
44 |
| -from django.template import engines |
45 |
| -from django.template.context_processors import csrf |
46 |
| -from django.template.response import TemplateResponse |
47 | 24 | from django.test import (
|
48 | 25 | RequestFactory,
|
49 |
| - SimpleTestCase, |
50 | 26 | TestCase,
|
51 |
| - TransactionTestCase, |
52 | 27 | override_settings,
|
53 | 28 | )
|
54 | 29 | from django.test.signals import setting_changed
|
55 |
| -from django.utils import timezone, translation |
56 |
| -from django.utils.cache import ( |
57 |
| - get_cache_key, |
58 |
| - learn_cache_key, |
59 |
| - patch_cache_control, |
60 |
| - patch_vary_headers, |
61 |
| -) |
62 |
| -from django.utils.encoding import force_text |
63 |
| -from django.views.decorators.cache import cache_page |
64 | 30 |
|
65 | 31 | ################################################################################
|
66 | 32 | # Setup Django for models import.
|
|
0 commit comments