summaryrefslogtreecommitdiff
path: root/tests/forms_tests
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2023-12-31 10:01:31 +0100
committerGitHub <noreply@github.com>2023-12-31 10:01:31 +0100
commitd88ec42bd0a37340c8477a6f20bf26e58bd84735 (patch)
treeabd9422f7fb34a19579a74515ce84d9f472cd226 /tests/forms_tests
parent81ccf92f154c6d9eac3e30bac0aa67574d0ace15 (diff)
Used addCleanup() in tests where appropriate.
Diffstat (limited to 'tests/forms_tests')
-rw-r--r--tests/forms_tests/tests/test_input_formats.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/tests/forms_tests/tests/test_input_formats.py b/tests/forms_tests/tests/test_input_formats.py
index 1923319759..7a0dfca8a7 100644
--- a/tests/forms_tests/tests/test_input_formats.py
+++ b/tests/forms_tests/tests/test_input_formats.py
@@ -12,9 +12,7 @@ class LocalizedTimeTests(SimpleTestCase):
# nl/formats.py has customized TIME_INPUT_FORMATS:
# ['%H:%M:%S', '%H.%M:%S', '%H.%M', '%H:%M']
activate("nl")
-
- def tearDown(self):
- deactivate()
+ self.addCleanup(deactivate)
def test_timeField(self):
"TimeFields can parse dates in the default format"
@@ -323,9 +321,7 @@ class SimpleTimeFormatTests(SimpleTestCase):
class LocalizedDateTests(SimpleTestCase):
def setUp(self):
activate("de")
-
- def tearDown(self):
- deactivate()
+ self.addCleanup(deactivate)
def test_dateField(self):
"DateFields can parse dates in the default format"
@@ -637,9 +633,7 @@ class SimpleDateFormatTests(SimpleTestCase):
class LocalizedDateTimeTests(SimpleTestCase):
def setUp(self):
activate("de")
-
- def tearDown(self):
- deactivate()
+ self.addCleanup(deactivate)
def test_dateTimeField(self):
"DateTimeFields can parse dates in the default format"