diff options
| author | Claude Paroz <claude@2xlibre.net> | 2016-11-19 21:54:19 +0100 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2017-01-18 13:44:34 +0100 |
| commit | f3c43ad1fd9556f0fd026a5dfa93c67a5cf186ca (patch) | |
| tree | 65ca40d4527b377845cdd382456383bf97caafa6 /tests/forms_tests | |
| parent | d7b9aaa366dd54ecc3142c588162e3adc7c2f7ac (diff) | |
Refs #23919 -- Removed python_2_unicode_compatible decorator usage
Diffstat (limited to 'tests/forms_tests')
| -rw-r--r-- | tests/forms_tests/models.py | 3 | ||||
| -rw-r--r-- | tests/forms_tests/tests/test_error_messages.py | 2 | ||||
| -rw-r--r-- | tests/forms_tests/tests/test_forms.py | 3 | ||||
| -rw-r--r-- | tests/forms_tests/tests/test_utils.py | 3 | ||||
| -rw-r--r-- | tests/forms_tests/widget_tests/test_clearablefileinput.py | 6 |
5 files changed, 2 insertions, 15 deletions
diff --git a/tests/forms_tests/models.py b/tests/forms_tests/models.py index be1b66bce6..fa63d08fd1 100644 --- a/tests/forms_tests/models.py +++ b/tests/forms_tests/models.py @@ -4,7 +4,6 @@ import tempfile from django.core.files.storage import FileSystemStorage from django.db import models -from django.utils.encoding import python_2_unicode_compatible callable_default_counter = itertools.count() @@ -55,7 +54,6 @@ class ChoiceModel(models.Model): null=True) -@python_2_unicode_compatible class ChoiceOptionModel(models.Model): """Destination for ChoiceFieldModel's ForeignKey. Can't reuse ChoiceModel because error_message tests require that it have no instances.""" @@ -132,7 +130,6 @@ class FileModel(models.Model): file = models.FileField(storage=temp_storage, upload_to='tests') -@python_2_unicode_compatible class Group(models.Model): name = models.CharField(max_length=10) diff --git a/tests/forms_tests/tests/test_error_messages.py b/tests/forms_tests/tests/test_error_messages.py index eb7debf936..10c7a92f7d 100644 --- a/tests/forms_tests/tests/test_error_messages.py +++ b/tests/forms_tests/tests/test_error_messages.py @@ -8,7 +8,6 @@ from django.forms import ( ) from django.template import Context, Template from django.test import SimpleTestCase, TestCase -from django.utils.encoding import python_2_unicode_compatible from django.utils.safestring import mark_safe from ..models import ChoiceModel @@ -216,7 +215,6 @@ class FormsErrorMessagesTestCase(SimpleTestCase, AssertFormErrorsMixin): def clean(self): raise ValidationError("I like to be awkward.") - @python_2_unicode_compatible class CustomErrorList(utils.ErrorList): def __str__(self): return self.as_divs() diff --git a/tests/forms_tests/tests/test_forms.py b/tests/forms_tests/tests/test_forms.py index b8ced2425c..dacd7739d3 100644 --- a/tests/forms_tests/tests/test_forms.py +++ b/tests/forms_tests/tests/test_forms.py @@ -21,7 +21,7 @@ from django.template import Context, Template from django.test import SimpleTestCase from django.test.utils import str_prefix from django.utils.datastructures import MultiValueDict -from django.utils.encoding import force_text, python_2_unicode_compatible +from django.utils.encoding import force_text from django.utils.html import format_html from django.utils.safestring import SafeData, mark_safe @@ -3375,7 +3375,6 @@ Good luck picking a username that doesn't already exist.</p> ) def test_errorlist_override(self): - @python_2_unicode_compatible class DivErrorList(ErrorList): def __str__(self): return self.as_divs() diff --git a/tests/forms_tests/tests/test_utils.py b/tests/forms_tests/tests/test_utils.py index d0dfaad370..f06b60a620 100644 --- a/tests/forms_tests/tests/test_utils.py +++ b/tests/forms_tests/tests/test_utils.py @@ -4,7 +4,7 @@ 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, python_2_unicode_compatible +from django.utils.encoding import force_text from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy @@ -101,7 +101,6 @@ class FormsUtilsTestCase(SimpleTestCase): '</ul>' ) - @python_2_unicode_compatible class VeryBadError: def __str__(self): return "A very bad error." diff --git a/tests/forms_tests/widget_tests/test_clearablefileinput.py b/tests/forms_tests/widget_tests/test_clearablefileinput.py index 3727d0c0df..dd7f04d0ac 100644 --- a/tests/forms_tests/widget_tests/test_clearablefileinput.py +++ b/tests/forms_tests/widget_tests/test_clearablefileinput.py @@ -1,11 +1,9 @@ from django.core.files.uploadedfile import SimpleUploadedFile from django.forms import ClearableFileInput -from django.utils.encoding import python_2_unicode_compatible from .base import WidgetTest -@python_2_unicode_compatible class FakeFieldFile(object): """ Quacks like a FieldFile (has a .url and unicode representation), but @@ -39,7 +37,6 @@ class ClearableFileInputTest(WidgetTest): A ClearableFileInput should escape name, filename, and URL when rendering HTML (#15182). """ - @python_2_unicode_compatible class StrangeFieldFile(object): url = "something?chapter=1§=2©=3&lang=en" @@ -110,7 +107,6 @@ class ClearableFileInputTest(WidgetTest): A ClearableFileInput should not mask exceptions produced while checking that it has a value. """ - @python_2_unicode_compatible class FailingURLFieldFile(object): @property def url(self): @@ -123,7 +119,6 @@ class ClearableFileInputTest(WidgetTest): self.widget.render('myfile', FailingURLFieldFile()) def test_url_as_property(self): - @python_2_unicode_compatible class URLFieldFile(object): @property def url(self): @@ -136,7 +131,6 @@ class ClearableFileInputTest(WidgetTest): self.assertInHTML('<a href="https://www.python.org/">value</a>', html) def test_return_false_if_url_does_not_exists(self): - @python_2_unicode_compatible class NoURLFieldFile(object): def __str__(self): return 'value' |
