mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Refs #36500 -- Rewrapped long docstrings and block comments via a script.
Rewrapped long docstrings and block comments to 79 characters + newline using script from https://github.com/medmunds/autofix-w505.
This commit is contained in:
@@ -75,7 +75,8 @@ def override_database_connection_timezone(timezone):
|
||||
try:
|
||||
orig_timezone = connection.settings_dict["TIME_ZONE"]
|
||||
connection.settings_dict["TIME_ZONE"] = timezone
|
||||
# Clear cached properties, after first accessing them to ensure they exist.
|
||||
# Clear cached properties, after first accessing them to ensure they
|
||||
# exist.
|
||||
connection.timezone
|
||||
del connection.timezone
|
||||
connection.timezone_name
|
||||
@@ -83,7 +84,8 @@ def override_database_connection_timezone(timezone):
|
||||
yield
|
||||
finally:
|
||||
connection.settings_dict["TIME_ZONE"] = orig_timezone
|
||||
# Clear cached properties, after first accessing them to ensure they exist.
|
||||
# Clear cached properties, after first accessing them to ensure they
|
||||
# exist.
|
||||
connection.timezone
|
||||
del connection.timezone
|
||||
connection.timezone_name
|
||||
@@ -450,8 +452,8 @@ class NewDatabaseTests(TestCase):
|
||||
Event.objects.create(dt=datetime.datetime(2011, 1, 1, 1, 30, 0, tzinfo=EAT))
|
||||
Event.objects.create(dt=datetime.datetime(2011, 1, 1, 4, 30, 0, tzinfo=EAT))
|
||||
with timezone.override(UTC):
|
||||
# These two dates fall in the same day in EAT, but in different days,
|
||||
# years and months in UTC.
|
||||
# These two dates fall in the same day in EAT, but in different
|
||||
# days, years and months in UTC.
|
||||
self.assertEqual(Event.objects.filter(dt__year=2011).count(), 1)
|
||||
self.assertEqual(Event.objects.filter(dt__month=1).count(), 1)
|
||||
self.assertEqual(Event.objects.filter(dt__day=1).count(), 1)
|
||||
@@ -1169,7 +1171,8 @@ class TemplateTests(SimpleTestCase):
|
||||
@skipIf(sys.platform == "win32", "Windows uses non-standard time zone names")
|
||||
def test_tz_template_context_processor(self):
|
||||
"""
|
||||
Test the django.template.context_processors.tz template context processor.
|
||||
Test the django.template.context_processors.tz template context
|
||||
processor.
|
||||
"""
|
||||
tpl = Template("{{ TIME_ZONE }}")
|
||||
context = Context()
|
||||
|
||||
Reference in New Issue
Block a user