コード例 #1
0
ファイル: test_common.py プロジェクト: CGTIC/Plone_SP
 def testPrepareObjectTabsDefaultView(self):
     self._invalidateRequestMemoizations()
     self.loginAsPortalOwner()
     self.app.REQUEST['ACTUAL_URL'] = self.folder.test.absolute_url() + '/edit'
     view = ContentViewsViewlet(self.folder.test, self.app.REQUEST, None)
     tabs = view.prepareObjectTabs()
     self.assertEqual(0, len([t for t in tabs if t['id'] == 'folderContents']))
     self.assertEqual(['edit'], [t['id'] for t in tabs if t['selected']])
コード例 #2
0
ファイル: test_common.py プロジェクト: RBINS/plone.app.layout
 def testPrepareObjectTabsOnPortalRoot(self):
     self._invalidateRequestMemoizations()
     self.loginAsPortalOwner()
     self.app.REQUEST['ACTUAL_URL'] = self.portal.absolute_url()
     view = ContentViewsViewlet(self.portal, self.app.REQUEST, None)
     tabs = view.prepareObjectTabs()
     self.assertEqual(tabs[0]['id'], 'folderContents')
     self.assertEqual(['view'], [t['id'] for t in tabs if t['selected']])
コード例 #3
0
 def testPrepareObjectTabsOnPortalRoot(self):
     self._invalidateRequestMemoizations()
     self.loginAsPortalOwner()
     self.app.REQUEST['ACTUAL_URL'] = self.portal.absolute_url()
     view = ContentViewsViewlet(self.portal, self.app.REQUEST, None)
     tabs = view.prepareObjectTabs()
     self.assertEqual(tabs[0]['id'], 'folderContents')
     self.assertEqual(['view'], [t['id'] for t in tabs if t['selected']])
コード例 #4
0
 def testPrepareObjectTabsNonFolder(self):
     self._invalidateRequestMemoizations()
     self.loginAsPortalOwner()
     self.app.REQUEST['ACTUAL_URL'] = self.folder.test.absolute_url()
     view = ContentViewsViewlet(self.folder.test, self.app.REQUEST, None)
     tabs = view.prepareObjectTabs()
     self.assertEqual(0,
                      len([t for t in tabs if t['id'] == 'folderContents']))
     self.assertEqual(['view'], [t['id'] for t in tabs if t['selected']])
コード例 #5
0
ファイル: test_common.py プロジェクト: CGTIC/Plone_SP
 def testPrepareObjectTabsNonStructuralFolder(self):
     self._invalidateRequestMemoizations()
     self.loginAsPortalOwner()
     self.app.REQUEST['ACTUAL_URL'] = self.folder.absolute_url()
     directlyProvides(self.folder, INonStructuralFolder)
     view = ContentViewsViewlet(self.folder, self.app.REQUEST, None)
     tabs = view.prepareObjectTabs()
     noLongerProvides(self.folder, INonStructuralFolder)
     self.assertEqual(0, len([t for t in tabs if t['id'] == 'folderContents']))
     self.assertEqual(['view'], [t['id'] for t in tabs if t['selected']])
コード例 #6
0
 def testPrepareObjectTabsDefaultView(self):
     self._invalidateRequestMemoizations()
     self.loginAsPortalOwner()
     self.app.REQUEST['ACTUAL_URL'] = '%s/edit?_authenticator=%s' % (
         self.folder.test.absolute_url(), auth.createToken())
     view = ContentViewsViewlet(self.folder.test, self.app.REQUEST, None)
     tabs = view.prepareObjectTabs()
     self.assertEqual(0,
                      len([t for t in tabs if t['id'] == 'folderContents']))
     self.assertEqual(['edit'], [t['id'] for t in tabs if t['selected']])
コード例 #7
0
 def testPrepareObjectTabsNonStructuralFolder(self):
     self._invalidateRequestMemoizations()
     self.loginAsPortalOwner()
     self.app.REQUEST['ACTUAL_URL'] = self.folder.absolute_url()
     directlyProvides(self.folder, INonStructuralFolder)
     view = ContentViewsViewlet(self.folder, self.app.REQUEST, None)
     tabs = view.prepareObjectTabs()
     noLongerProvides(self.folder, INonStructuralFolder)
     self.assertEquals(
         0, len([t for t in tabs if t['id'] == 'folderContents']))
     self.assertEquals(['view'], [t['id'] for t in tabs if t['selected']])