feat: add "complete" (sic) timezone support
at least for now, this is enough to let admin define the global default timezone for app, and override system local timezone. eventually should support per-user timezone..some day..
This commit is contained in:
parent
286c683c93
commit
7fcb331806
10 changed files with 274 additions and 93 deletions
|
|
@ -46,6 +46,26 @@ class TestAppInfoView(WebTestCase):
|
|||
view = self.make_view()
|
||||
context = view.configure_get_context()
|
||||
|
||||
def test_configure_check_timezone(self):
|
||||
view = self.make_view()
|
||||
|
||||
# normal
|
||||
with patch.object(self.request, "GET", new={"tzname": "America/Chicago"}):
|
||||
result = view.configure_check_timezone()
|
||||
self.assertFalse(result["invalid"])
|
||||
|
||||
# invalid
|
||||
with patch.object(self.request, "GET", new={"tzname": "bad_name"}):
|
||||
result = view.configure_check_timezone()
|
||||
self.assertEqual(
|
||||
result["invalid"], "'No time zone found with key bad_name'"
|
||||
)
|
||||
|
||||
# missing input
|
||||
with patch.object(self.request, "GET", new={}):
|
||||
result = view.configure_check_timezone()
|
||||
self.assertEqual(result["invalid"], "Must provide 'tzname' parameter.")
|
||||
|
||||
|
||||
class TestSettingView(WebTestCase):
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue