Changeset 3152 in products for quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testSecurity.py
- Timestamp:
- Apr 20, 2011 8:20:36 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testSecurity.py
r2538 r3152 7 7 from Products.CMFPlone.utils import _createObjectByType 8 8 9 9 10 class MixinSecurity(FunctionalTestCase): 10 11 11 12 def getview(self, vpath): 12 return self.publish("/"+self.portal.absolute_url(1)+"/"+vpath, self.auth) 13 return self.publish("/" + self.portal.absolute_url(1) + \ 14 "/" + vpath, self.auth) 13 15 14 16 … … 18 20 super(TestSecurityConfigletManager, self).afterSetUp() 19 21 self.auth = "admin:admin" 20 self.portal.portal_membership.addMember('admin', 'admin', ('Manager',), []) 22 self.portal.portal_membership.addMember('admin', 'admin', 23 ('Manager',), []) 21 24 22 25 def testConfigOverview(self): … … 60 63 from DateTime import DateTime 61 64 65 62 66 class TestSecuritySiteMaps(MixinSecurity): 63 67 … … 73 77 for smtype, smdata in SM_TYPES.items(): 74 78 _createObjectByType("Sitemap", self.portal, id=smdata["id"], 75 sitemapType=smtype, portalTypes=smdata["types"]) 79 sitemapType=smtype, 80 portalTypes=smdata["types"]) 76 81 sm = getattr(self.portal, smdata["id"]) 77 82 sm.at_post_create_script() … … 81 86 self.my_doc = _createObjectByType('Document', self.portal, id='my_doc') 82 87 self.workflow.doActionFor(self.my_doc, 'publish') 83 self.my_news = _createObjectByType('News Item', self.portal, id='my_news') 88 self.my_news = _createObjectByType('News Item', self.portal, 89 id='my_news') 84 90 self.my_news.edit(title="My News Item (test)", 85 91 effectiveDate=DateTime().strftime("%Y-%m-%d")) 86 92 self.workflow.doActionFor(self.my_news, 'publish') 87 # mobile content must provides additional interfaces to fall into mobile sitemap 93 # mobile content must provides additional interfaces 94 # to fall into mobile sitemap 88 95 alsoProvides(self.my_doc, IMobileMarker) 89 96 self.my_doc.reindexObject() … … 100 107 self.assert_("loc" in start) 101 108 self.assert_(self.my_doc.absolute_url() in data) 102 109 103 110 def testNewsSM(self): 104 111 resp = self.getview("news-sitemap.xml") … … 107 114 self.assert_("n:name" in start) 108 115 self.assert_("My News Item" in data) 109 116 110 117 def testMobileSM(self): 111 118 resp = self.getview("mobile-sitemap.xml") … … 114 121 self.assert_("loc" in start) 115 122 self.assert_(self.my_doc.absolute_url() in data) 116 123 117 124 118 125 def test_suite():
Note: See TracChangeset
for help on using the changeset viewer.