def test_set_time(self): test_html = self.marionette.absolute_url("datetimePage.html") self.marionette.navigate(test_html) element = self.marionette.find_element("id", "time-test") dt_value = DateTimeValue(element) dt_value.time = datetime(1998, 11, 19, 9, 8, 7) self.assertEqual(element.get_attribute("value"), "09:08:07")
def test_set_date(self): test_html = self.marionette.absolute_url("datetimePage.html") self.marionette.navigate(test_html) element = self.marionette.find_element("id", "date-test") dt_value = DateTimeValue(element) dt_value.date = datetime(1998, 6, 2) self.assertEqual(element.get_attribute("value"), "1998-06-02")