def testTimeZoneSaved(self): # Test case should: # # - Load the repo (Done in setUp()) # - Get the repo's default DefaultTimeZone defaultTzItem = DefaultTimeZone.get(view=self.rep.view) # - Change the default DefaultTimeZone defaultTzItem.tzinfo = PyICU.ICUtzinfo.getInstance("GMT") self.failUnlessEqual(defaultTzItem.tzinfo, PyICU.ICUtzinfo.getInstance("GMT")) # - Save the repo self.rep.commit() self.rep.closeView() # - Change the DefaultTimeZone default timezone PyICU.TimeZone.adoptDefault(PyICU.TimeZone.createTimeZone("US/Pacific")) # - Reopen the repo self.rep.openView() self.manager = None # - Now check the default timezone defaultTzItem = DefaultTimeZone.get(view=self.rep.view) # ... see that it changed to what's in the repo self.failIfEqual(PyICU.ICUtzinfo.getInstance("US/Pacific"), defaultTzItem.tzinfo) # ... and make sure it is still the default! self.failUnlessEqual(defaultTzItem.tzinfo, PyICU.ICUtzinfo.getDefault())
def setUp(self): self.defaultTzItem = DefaultTimeZone.get()
def testPerView(self): defaultTzItemOne = DefaultTimeZone.get(view=self.rep.view) defaultTzItemTwo = DefaultTimeZone.get() self.failIf(defaultTzItemOne is defaultTzItemTwo)
def testGetTimeZone(self): defaultTzItem = DefaultTimeZone.get(view=self.rep.view) self.failUnlessEqual(defaultTzItem.tzinfo, PyICU.ICUtzinfo.getDefault())