Changeset 1887 in products for quintagroup.seoptimizer/branches/refactoring2.3.0/quintagroup/seoptimizer/tests
- Timestamp:
- Mar 11, 2010 2:00:57 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.seoptimizer/branches/refactoring2.3.0/quintagroup/seoptimizer/tests/testResponse.py
r1877 r1887 35 35 my_doc = self.portal.invokeFactory('Document', id='my_doc') 36 36 my_doc = self.portal['my_doc'] 37 self.canonurl = 'http://nohost/plone/test.html'38 37 self.sp.manage_changeProperties(**GLOBAL_CUSTOM_METATAGS) 39 38 self.sp.manage_changeProperties(settings_use_keywords_sg=3, settings_use_keywords_lg=2) 40 39 abs_path = "/%s" % my_doc.absolute_url(1) 41 40 self.form_data = {'seo_description': 'it is description, test keyword1', 'seo_keywords_override:int': 1, 'seo_custommetatags_override:int': 1, 42 'seo_robots_override:int': 1, 'seo_robots': 'ALL', 'seo_description_override:int': 1, 'seo_canonical_override:int': 1,41 'seo_robots_override:int': 1, 'seo_robots': 'ALL', 'seo_description_override:int': 1, 43 42 'seo_keywords:list': 'keyword1', 'seo_html_comment': 'no comments', 44 43 'seo_title_override:int': 1, 'seo_title': 'hello world', 'seo_html_comment_override:int': 1, 45 'seo_distribution_override:int': 1, 'seo_distribution': 'Global', ' seo_canonical': self.canonurl, 'form.submitted:int': 1}44 'seo_distribution_override:int': 1, 'seo_distribution': 'Global', 'form.submitted:int': 1} 46 45 st = '' 47 46 for d in CUSTOM_METATAGS: … … 135 134 self.assert_(m, "Global custom meta tag %s not applied." % 'metatag1') 136 135 137 def testCanonical(self):138 m = re.match('.*<link rel="canonical" href="%s" />' % self.canonurl, self.html, re.S|re.M)139 self.assert_(m, self.canonurl)140 141 def testDefaultCanonical(self):142 """Default canonical url mast add document absolute_url143 """144 # Delete custom canonical url145 my_doc = self.portal['my_doc']146 my_doc._delProperty(id='qSEO_canonical')147 # Get document without customized canonical url148 abs_path = "/%s" % my_doc.absolute_url(1)149 self.html = self.publish(abs_path, self.basic_auth).getBody()150 151 my_url = my_doc.absolute_url()152 m = re.match('.*<link rel="canonical" href="%s" />' % my_url, self.html, re.S|re.M)153 self.assert_(m, my_url)154 155 136 def test_suite(): 156 137 from unittest import TestSuite, makeSuite
Note: See TracChangeset
for help on using the changeset viewer.