From d88ec42bd0a37340c8477a6f20bf26e58bd84735 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Sun, 31 Dec 2023 10:01:31 +0100 Subject: Used addCleanup() in tests where appropriate. --- tests/forms_tests/tests/test_input_formats.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'tests/forms_tests') 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" -- cgit v1.3