summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2011-12-04 22:11:12 +0000
committerAymeric Augustin <aymeric.augustin@m4x.org>2011-12-04 22:11:12 +0000
commit33bb3cd47cb287daa1246b705eff0f55bf72d284 (patch)
tree9b97d5c8dd37e868bf9ad2479245cc04de717cce /tests
parente42360b56b8a215e5752b42b63fa5f2a0b2e78fd (diff)
Fixed #17343 -- Changed the {% now %} tag to use the current time zone when time zone support is enabled. Thanks oinopion for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17169 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/modeltests/timezones/tests.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/modeltests/timezones/tests.py b/tests/modeltests/timezones/tests.py
index 5d86e9322e..774595be05 100644
--- a/tests/modeltests/timezones/tests.py
+++ b/tests/modeltests/timezones/tests.py
@@ -790,6 +790,13 @@ class TemplateTests(BaseDateTimeTests):
self.assertTrue(tpl.render(ctx).startswith("2011"))
timezone._localtime = None
+ def test_now_template_tag_uses_current_time_zone(self):
+ # Regression for #17343
+ tpl = Template("{% now \"O\" %}")
+ self.assertEqual(tpl.render(Context({})), "+0300")
+ with timezone.override(ICT):
+ self.assertEqual(tpl.render(Context({})), "+0700")
+
TemplateTests = override_settings(DATETIME_FORMAT='c', USE_L10N=False, USE_TZ=True)(TemplateTests)
#@override_settings(DATETIME_FORMAT='c', USE_L10N=False, USE_TZ=False)