summaryrefslogtreecommitdiff
path: root/tests/forms_tests
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2016-12-29 16:27:49 +0100
committerClaude Paroz <claude@2xlibre.net>2017-01-18 20:18:46 +0100
commit7b2f2e74adb36a4334e83130f6abc2f79d395235 (patch)
tree313387ba6a6f1311b43cf5fb4f2576d2d6c4f805 /tests/forms_tests
parentf6acd1d271122d66de8061e75ae26137ddf02658 (diff)
Refs #23919 -- Removed six.<various>_types usage
Thanks Tim Graham and Simon Charette for the reviews.
Diffstat (limited to 'tests/forms_tests')
-rw-r--r--tests/forms_tests/field_tests/test_filepathfield.py3
-rw-r--r--tests/forms_tests/field_tests/test_typedchoicefield.py3
-rw-r--r--tests/forms_tests/tests/test_utils.py3
-rw-r--r--tests/forms_tests/tests/tests.py3
4 files changed, 4 insertions, 8 deletions
diff --git a/tests/forms_tests/field_tests/test_filepathfield.py b/tests/forms_tests/field_tests/test_filepathfield.py
index 07ebe67f06..71164b5b7a 100644
--- a/tests/forms_tests/field_tests/test_filepathfield.py
+++ b/tests/forms_tests/field_tests/test_filepathfield.py
@@ -2,12 +2,11 @@ import os.path
from django.forms import FilePathField, ValidationError, forms
from django.test import SimpleTestCase
-from django.utils import six
from django.utils._os import upath
def fix_os_paths(x):
- if isinstance(x, six.string_types):
+ if isinstance(x, str):
return x.replace('\\', '/')
elif isinstance(x, tuple):
return tuple(fix_os_paths(list(x)))
diff --git a/tests/forms_tests/field_tests/test_typedchoicefield.py b/tests/forms_tests/field_tests/test_typedchoicefield.py
index c08a8bb611..bf0fdb4d47 100644
--- a/tests/forms_tests/field_tests/test_typedchoicefield.py
+++ b/tests/forms_tests/field_tests/test_typedchoicefield.py
@@ -2,7 +2,6 @@ import decimal
from django.forms import TypedChoiceField, ValidationError
from django.test import SimpleTestCase
-from django.utils import six
class TypedChoiceFieldTest(SimpleTestCase):
@@ -53,7 +52,7 @@ class TypedChoiceFieldTest(SimpleTestCase):
self.assertFalse(f.has_changed('1', '1'))
f = TypedChoiceField(
- choices=[('', '---------'), ('a', "a"), ('b', "b")], coerce=six.text_type,
+ choices=[('', '---------'), ('a', "a"), ('b', "b")], coerce=str,
required=False, initial=None, empty_value=None,
)
self.assertFalse(f.has_changed(None, ''))
diff --git a/tests/forms_tests/tests/test_utils.py b/tests/forms_tests/tests/test_utils.py
index f06b60a620..f52c195637 100644
--- a/tests/forms_tests/tests/test_utils.py
+++ b/tests/forms_tests/tests/test_utils.py
@@ -3,7 +3,6 @@ import copy
from django.core.exceptions import ValidationError
from django.forms.utils import ErrorDict, ErrorList, flatatt
from django.test import SimpleTestCase
-from django.utils import six
from django.utils.encoding import force_text
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy
@@ -63,7 +62,7 @@ class FormsUtilsTestCase(SimpleTestCase):
)
# Can take a unicode string.
self.assertHTMLEqual(
- six.text_type(ErrorList(ValidationError("Not \u03C0.").messages)),
+ str(ErrorList(ValidationError("Not \u03C0.").messages)),
'<ul class="errorlist"><li>Not π.</li></ul>'
)
# Can take a lazy string.
diff --git a/tests/forms_tests/tests/tests.py b/tests/forms_tests/tests/tests.py
index 025b749762..0119410fc8 100644
--- a/tests/forms_tests/tests/tests.py
+++ b/tests/forms_tests/tests/tests.py
@@ -7,7 +7,6 @@ from django.forms import (
)
from django.forms.models import ModelFormMetaclass
from django.test import SimpleTestCase, TestCase
-from django.utils import six
from ..models import (
BoundaryModel, ChoiceFieldModel, ChoiceModel, ChoiceOptionModel, Defaults,
@@ -97,7 +96,7 @@ class ModelFormCallableModelDefault(TestCase):
choices = list(ChoiceFieldForm().fields['choice'].choices)
self.assertEqual(len(choices), 1)
- self.assertEqual(choices[0], (option.pk, six.text_type(option)))
+ self.assertEqual(choices[0], (option.pk, str(option)))
def test_callable_initial_value(self):
"The initial value for a callable default returning a queryset is the pk (refs #13769)"