Change timezone to America/Los_Angeles to expose DateTime exceptions

This commit is contained in:
Jon Pentland 2022-10-24 22:09:49 +02:00
parent 2380bdacb3
commit a069f49719
2 changed files with 5 additions and 5 deletions

View File

@ -38,7 +38,7 @@ class ConversationTest(unittest.TestCase):
# Set the portal timezone to something non-utc
reg_key = "plone.portal_timezone"
registry = getUtility(IRegistry)
registry[reg_key] = "Europe/Berlin"
registry[reg_key] = "America/Los_Angeles"
self.typetool = self.portal.portal_types
self.portal_discussion = getToolByName(
@ -98,8 +98,8 @@ class ConversationTest(unittest.TestCase):
conversation.addComment(comment)
# Check that comments have the correct portal timezones
self.assertTrue(comment.creation_date.tzinfo, tz.gettz("Europe/Berlin"))
self.assertTrue(comment.modification_date.tzinfo, tz.gettz("Europe/Berlin"))
self.assertTrue(comment.creation_date.tzinfo, tz.gettz("America/Los_Angeles"))
self.assertTrue(comment.modification_date.tzinfo, tz.gettz("America/Los_Angeles"))
# Remove the timezone from the comment dates
comment.creation_date = datetime.utcnow()

View File

@ -40,10 +40,10 @@ class ConversationIndexersTest(unittest.TestCase):
workflow = self.portal.portal_workflow
workflow.doActionFor(self.portal.doc1, "publish")
# Change the timezone to europe to test timezones properly
# Change the timezone to PDT to test timezones properly
reg_key = "plone.portal_timezone"
registry = getUtility(IRegistry)
registry[reg_key] = "Europe/Berlin"
registry[reg_key] = "America/Los_Angeles"
self.portal_timezone = tz.gettz(default_timezone())
# Create a conversation.