diff options
| author | Simon Charette <charettes@users.noreply.github.com> | 2017-01-19 02:39:46 -0500 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2017-01-19 08:39:46 +0100 |
| commit | cecc079168e8669138728d31611ff3a1e7eb3a9f (patch) | |
| tree | 2415083d44f84c6f206930fc689a8c0e50a98caa /tests/forms_tests/widget_tests | |
| parent | a5563963397aeee30c32e3c1dab31bfe453ca89f (diff) | |
Refs #23919 -- Stopped inheriting from object to define new style classes.
Diffstat (limited to 'tests/forms_tests/widget_tests')
| -rw-r--r-- | tests/forms_tests/widget_tests/test_clearablefileinput.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/forms_tests/widget_tests/test_clearablefileinput.py b/tests/forms_tests/widget_tests/test_clearablefileinput.py index dd7f04d0ac..eea7054541 100644 --- a/tests/forms_tests/widget_tests/test_clearablefileinput.py +++ b/tests/forms_tests/widget_tests/test_clearablefileinput.py @@ -4,7 +4,7 @@ from django.forms import ClearableFileInput from .base import WidgetTest -class FakeFieldFile(object): +class FakeFieldFile: """ Quacks like a FieldFile (has a .url and unicode representation), but doesn't require us to care about storages etc. @@ -37,7 +37,7 @@ class ClearableFileInputTest(WidgetTest): A ClearableFileInput should escape name, filename, and URL when rendering HTML (#15182). """ - class StrangeFieldFile(object): + class StrangeFieldFile: url = "something?chapter=1§=2©=3&lang=en" def __str__(self): @@ -107,7 +107,7 @@ class ClearableFileInputTest(WidgetTest): A ClearableFileInput should not mask exceptions produced while checking that it has a value. """ - class FailingURLFieldFile(object): + class FailingURLFieldFile: @property def url(self): raise ValueError('Canary') @@ -119,7 +119,7 @@ class ClearableFileInputTest(WidgetTest): self.widget.render('myfile', FailingURLFieldFile()) def test_url_as_property(self): - class URLFieldFile(object): + class URLFieldFile: @property def url(self): return 'https://www.python.org/' @@ -131,7 +131,7 @@ class ClearableFileInputTest(WidgetTest): self.assertInHTML('<a href="https://www.python.org/">value</a>', html) def test_return_false_if_url_does_not_exists(self): - class NoURLFieldFile(object): + class NoURLFieldFile: def __str__(self): return 'value' |
