datetime: Add functional test for setting time zone

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Joseph Nuthalapati authored and James Valleroy committed 2018-10-15 16:12:41 -04:00
1 parent d01c36a8f5
commit f16fe404f2
3 files changed
+27

No files matched your search

@@ -31,3 +31,7 @@ Scenario: Disable network time application
Given the network time application is enabled
When I disable the network time application
Then the network time service should not be running
Scenario: Set timezone
When I set the time zone to Africa/Abidjan
Then the time zone should be Africa/Abidjan
@@ -47,6 +47,16 @@ def ntp_is_disabled(browser):
application.disable(browser, 'ntp')
@when(parsers.parse('I set the time zone to {time_zone:S}'))
def time_zone_set(browser, time_zone):
application.time_zone_set(browser, time_zone)
@then(parsers.parse('the time zone should be {time_zone:S}'))
def time_zone_assert(browser, time_zone):
assert time_zone == application.time_zone_get(browser)
@given(parsers.parse('the service discovery application is enabled'))
def avahi_is_enabled(browser):
application.enable(browser, 'avahi')
+13
View File
@@ -322,3 +322,16 @@ def ikiwiki_wiki_exists(browser):
browser.find_link_by_href('/plinth/apps/ikiwiki/manage/').first.click()
wiki = browser.find_link_by_href('/ikiwiki/wiki')
return bool(wiki)
def time_zone_set(browser, time_zone):
"""Set the system time zone."""
interface.nav_to_module(browser, 'datetime')
browser.select('time_zone', time_zone)
interface.submit(browser, form_class='form-configuration')
def time_zone_get(browser):
"""Set the system time zone."""
interface.nav_to_module(browser, 'datetime')
return browser.find_by_name('time_zone').first.value