mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Refs #23919 -- Removed most of remaining six usage
Thanks Tim Graham for the review.
This commit is contained in:
14
tests/cache/tests.py
vendored
14
tests/cache/tests.py
vendored
@@ -3,6 +3,7 @@
|
||||
import copy
|
||||
import io
|
||||
import os
|
||||
import pickle
|
||||
import re
|
||||
import shutil
|
||||
import tempfile
|
||||
@@ -33,7 +34,7 @@ from django.test import (
|
||||
ignore_warnings, mock, override_settings,
|
||||
)
|
||||
from django.test.signals import setting_changed
|
||||
from django.utils import six, timezone, translation
|
||||
from django.utils import timezone, translation
|
||||
from django.utils.cache import (
|
||||
get_cache_key, learn_cache_key, patch_cache_control,
|
||||
patch_response_headers, patch_vary_headers,
|
||||
@@ -44,11 +45,6 @@ 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
|
||||
|
||||
|
||||
# functions/classes for complex data type tests
|
||||
def f():
|
||||
@@ -978,7 +974,7 @@ class DBCacheTests(BaseCacheTests, TransactionTestCase):
|
||||
self._perform_cull_test(caches['zero_cull'], 50, 18)
|
||||
|
||||
def test_second_call_doesnt_crash(self):
|
||||
out = six.StringIO()
|
||||
out = io.StringIO()
|
||||
management.call_command('createcachetable', stdout=out)
|
||||
self.assertEqual(out.getvalue(), "Cache table 'test cache table' already exists.\n" * len(settings.CACHES))
|
||||
|
||||
@@ -988,7 +984,7 @@ class DBCacheTests(BaseCacheTests, TransactionTestCase):
|
||||
LOCATION='createcachetable_dry_run_mode'
|
||||
))
|
||||
def test_createcachetable_dry_run_mode(self):
|
||||
out = six.StringIO()
|
||||
out = io.StringIO()
|
||||
management.call_command('createcachetable', dry_run=True, stdout=out)
|
||||
output = out.getvalue()
|
||||
self.assertTrue(output.startswith("CREATE TABLE"))
|
||||
@@ -999,7 +995,7 @@ class DBCacheTests(BaseCacheTests, TransactionTestCase):
|
||||
specifying the table name).
|
||||
"""
|
||||
self.drop_table()
|
||||
out = six.StringIO()
|
||||
out = io.StringIO()
|
||||
management.call_command(
|
||||
'createcachetable',
|
||||
'test cache table',
|
||||
|
||||
Reference in New Issue
Block a user