Пример #1
0
 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())
Пример #2
0
 def setUp(self):
     self.defaultTzItem = DefaultTimeZone.get()
Пример #3
0
 def testPerView(self):
     defaultTzItemOne = DefaultTimeZone.get(view=self.rep.view)
     defaultTzItemTwo = DefaultTimeZone.get()
     
     self.failIf(defaultTzItemOne is defaultTzItemTwo)
Пример #4
0
 def testGetTimeZone(self):
     defaultTzItem = DefaultTimeZone.get(view=self.rep.view)
     
     self.failUnlessEqual(defaultTzItem.tzinfo, PyICU.ICUtzinfo.getDefault())