summaryrefslogtreecommitdiff
path: root/tests/timezones/tests.py
diff options
context:
space:
mode:
authorAhmed Nassar <a.moh.nassar00@gmail.com>2025-04-08 09:49:09 +0200
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2025-04-09 09:49:14 +0200
commit522dd021b2738d15723448808606491063ff2e70 (patch)
tree544f3959f986f55749a7e5d457d9ce85aeeb67d9 /tests/timezones/tests.py
parenta627829e7b28bcb82129ab9fc3fa9c03d130f636 (diff)
Fixed #35986 -- Fixed test classes with @translation.override decorator.
Co-authored-by: Simon Charette <charette.s@gmail.com>
Diffstat (limited to 'tests/timezones/tests.py')
-rw-r--r--tests/timezones/tests.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/timezones/tests.py b/tests/timezones/tests.py
index 815da17026..fd8b49fdef 100644
--- a/tests/timezones/tests.py
+++ b/tests/timezones/tests.py
@@ -921,9 +921,13 @@ class SerializationTests(SimpleTestCase):
self.assertEqual(obj.dt, dt)
-@translation.override(None)
@override_settings(DATETIME_FORMAT="c", TIME_ZONE="Africa/Nairobi", USE_TZ=True)
class TemplateTests(SimpleTestCase):
+ @classmethod
+ def setUpClass(cls):
+ cls.enterClassContext(translation.override(None))
+ super().setUpClass()
+
@requires_tz_support
def test_localtime_templatetag_and_filters(self):
"""
@@ -1324,7 +1328,6 @@ class NewFormsTests(TestCase):
self.assertIn("2011-09-01 17:20:30", str(form))
-@translation.override(None)
@override_settings(
DATETIME_FORMAT="c",
TIME_ZONE="Africa/Nairobi",
@@ -1334,6 +1337,7 @@ class NewFormsTests(TestCase):
class AdminTests(TestCase):
@classmethod
def setUpTestData(cls):
+ cls.enterClassContext(translation.override(None))
cls.u1 = User.objects.create_user(
password="secret",
last_login=datetime.datetime(2007, 5, 30, 13, 20, 10, tzinfo=UTC),