Ignore:
Timestamp:
May 19, 2009 9:43:04 AM (15 years ago)
Author:
piv
Message:

fix page title in case it equals portal title, add appropriate test, update documentation, ready for tagging

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.seoptimizer/trunk/quintagroup/seoptimizer/tests/testQSEOptimizer.py

    r959 r1052  
    185185        self.html = self.publish(abs_path, self.basic_auth).getBody() 
    186186 
     187        # now setup page with title equal to plone site's title 
     188        my_doc2 = self.portal.invokeFactory('Document', id='my_doc2') 
     189        my_doc2 = self.portal['my_doc2'] 
     190        my_doc2.update(title=self.portal.Title()) 
     191        wf_tool.doActionFor(my_doc2, 'publish') 
     192        abs_path2 = "/%s" % my_doc2.absolute_url(1) 
     193        self.html2 = self.publish(abs_path2, self.basic_auth).getBody() 
     194 
    187195    def testTitle(self): 
    188196        m = re.match('.*<title>\\s*hello world\\s*</title>', self.html, re.S|re.M) 
    189197        self.assert_(m, 'Title not set in') 
     198 
     199    def testTitleDuplication(self): 
     200        """If we are not overriding page title and current page title equals title of the plone site 
     201        then there should be no concatenation of both titles. Only one should be displayed. 
     202        """ 
     203        m = re.match('.*<title>\\s*%s\\s*</title>' % self.portal.Title(), self.html2, re.S|re.M) 
     204        self.assert_(m, 'Title is not set correctly, perhaps it is duplicated with plone site title') 
    190205 
    191206    def testDescription(self): 
Note: See TracChangeset for help on using the changeset viewer.