mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Refs #23919 -- Removed most of remaining six usage
Thanks Tim Graham for the review.
This commit is contained in:
parent
7b2f2e74ad
commit
2b281cc35e
180 changed files with 421 additions and 559 deletions
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',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue