merge r47140, r47290, r47579 from davisagli-features: fix timezone handling when migrating legacy comments and when indexing

svn path=/plone.app.discussion/trunk/; revision=48358
This commit is contained in:
David Glick
2011-04-02 21:26:36 +00:00
parent 9d83b4f0e6
commit 636bca745c
5 changed files with 27 additions and 12 deletions
+3 -3
View File
@@ -151,11 +151,11 @@ class CommentIndexersTest(PloneTestCase):
def test_dates(self):
# Test if created, modified, effective etc. are set correctly
self.assertEquals(catalog.created(self.comment)(),
DateTime(2006, 9, 17, 14, 18, 12))
DateTime(2006, 9, 17, 14, 18, 12, 'GMT'))
self.assertEquals(catalog.effective(self.comment)(),
DateTime(2006, 9, 17, 14, 18, 12))
DateTime(2006, 9, 17, 14, 18, 12, 'GMT'))
self.assertEquals(catalog.modified(self.comment)(),
DateTime(2008, 3, 12, 7, 32, 52))
DateTime(2008, 3, 12, 7, 32, 52, 'GMT'))
def test_searchable_text(self):
# Test if searchable text is a concatenation of title and comment text
+2 -2
View File
@@ -47,8 +47,8 @@ class MigrationTest(PloneTestCase):
self.doc.talkback.createReply('My Title', 'My Text', Creator='Jim')
reply = talkback.getReplies()[0]
reply.setReplyTo(self.doc)
reply.creation_date = DateTime(2003, 3, 11, 9, 28, 6)
reply.modification_date = DateTime(2009, 7, 12, 19, 38, 7)
reply.creation_date = DateTime(2003, 3, 11, 9, 28, 6, 'GMT')
reply.modification_date = DateTime(2009, 7, 12, 19, 38, 7, 'GMT')
self.assertEquals(reply.Title(), 'My Title')
self.assertEquals(reply.EditableBody(), 'My Text')
self.failUnless('Jim' in reply.listCreators())