Changeset 1459 in products


Ignore:
Timestamp:
Dec 16, 2009 1:13:22 PM (10 years ago)
Author:
mylan
Message:

plone-issue-#3: force change modification date on changing SEO properties for object

Location:
qSEOptimizer/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • qSEOptimizer/trunk/skins/qSEOptimizer/qseo_properties_edit.cpy

    r1075 r1459  
    5353if delete_list: context.manage_delProperties(delete_list) 
    5454 
     55from DateTime import DateTime 
     56kwargs = {'modification_date' : DateTime()} 
     57context.plone_utils.contentEdit(context, **kwargs) 
     58 
    5559msg ='Content SEO properties have been saved.' 
    5660try: 
  • qSEOptimizer/trunk/tests/testQSEOptimizer.py

    r1 r1459  
    347347 
    348348 
    349 TESTS = [TestInstallation, TestResponse, TestExposeDCMetaTags] 
     349class TestBugs(PloneTestCase.FunctionalTestCase): 
     350 
     351    def afterSetUp(self): 
     352        self.qi = self.portal.portal_quickinstaller 
     353        self.qi.installProduct(PRODUCT) 
     354        #self.portal.changeSkin('Plone Default') 
     355 
     356        self.basic_auth = 'portal_manager:secret' 
     357        uf = self.app.acl_users 
     358        uf.userFolderAddUser('portal_manager', 'secret', ['Manager'], []) 
     359        user = uf.getUserById('portal_manager') 
     360        if not hasattr(user, 'aq_base'): 
     361            user = user.__of__(uf) 
     362        newSecurityManager(None, user) 
     363 
     364    def test_modification_date(self): 
     365        """ Modification date changing on SEO properties edit """ 
     366        my_doc = self.portal.invokeFactory('Document', id='my_doc') 
     367        my_doc = self.portal['my_doc'] 
     368 
     369        md_before = my_doc.modification_date 
     370        my_doc.qseo_properties_edit(title="New Title") 
     371        md_after = my_doc.modification_date 
     372 
     373        self.assertNotEqual(md_before, md_after) 
     374 
     375 
     376TESTS = [TestInstallation, 
     377         TestResponse, 
     378         TestExposeDCMetaTags, 
     379         TestBugs, 
     380         ] 
    350381 
    351382def test_suite(): 
Note: See TracChangeset for help on using the changeset viewer.