Changeset 1458 in products


Ignore:
Timestamp:
Dec 16, 2009 12:59:11 PM (12 years ago)
Author:
mylan
Message:

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

Location:
quintagroup.seoptimizer/trunk/quintagroup/seoptimizer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/skins/quintagroup.seoptimizer/qseo_properties_edit.cpy

    r1269 r1458  
    7070if delete_list: context.manage_delProperties(delete_list) 
    7171 
     72from DateTime import DateTime 
     73kwargs = {'modification_date' : DateTime()} 
     74context.plone_utils.contentEdit(context, **kwargs) 
     75 
    7276msg ='Content SEO properties have been saved.' 
    7377try: 
  • quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/tests/testQSEOptimizer.py

    r1313 r1458  
    544544           "Wrong BASE URL for folder: %s , all must be : %s" % (burls, myfldrurl)) 
    545545 
     546 
     547class TestBugs(PloneTestCase.FunctionalTestCase): 
     548 
     549    def afterSetUp(self): 
     550        self.qi = self.portal.portal_quickinstaller 
     551        self.qi.installProduct(PRODUCT) 
     552        #self.portal.changeSkin('Plone Default') 
     553 
     554        self.basic_auth = 'portal_manager:secret' 
     555        uf = self.app.acl_users 
     556        uf.userFolderAddUser('portal_manager', 'secret', ['Manager'], []) 
     557        user = uf.getUserById('portal_manager') 
     558        if not hasattr(user, 'aq_base'): 
     559            user = user.__of__(uf) 
     560        newSecurityManager(None, user) 
     561 
     562    def test_modification_date(self): 
     563        """ Modification date changing on SEO properties edit """ 
     564        my_doc = self.portal.invokeFactory('Document', id='my_doc') 
     565        my_doc = self.portal['my_doc'] 
     566 
     567        md_before = my_doc.modification_date 
     568        my_doc.qseo_properties_edit(title="New Title") 
     569        md_after = my_doc.modification_date 
     570 
     571        self.assertNotEqual(md_before, md_after) 
     572 
     573         
    546574TESTS = [TestBeforeInstall, 
    547575         TestInstallation, 
     
    551579         TestMetaTagsDuplication, 
    552580         TestBaseURL, 
     581         TestBugs, 
    553582        ] 
    554583 
Note: See TracChangeset for help on using the changeset viewer.