コード例 #1
0
 def testSet1OnPortalRoot(self):
     self._invalidateRequestMemoizations()
     self.loginAsPortalOwner()
     self.app.REQUEST['ACTUAL_URL'] = self.portal.absolute_url()
     view = ContentViewsViewlet(self.portal, self.app.REQUEST, None)
     view.update()
     self.assertEqual(view.tabSet1[0]['id'], 'folderContents')
コード例 #2
0
ファイル: test_common.py プロジェクト: plone/plone.app.layout
 def test_set1_on_portal_root(self):
     self._invalidateRequestMemoizations()
     setRoles(self.portal, TEST_USER_ID, ['Manager', 'Member'])
     self.app.REQUEST['ACTUAL_URL'] = self.portal.absolute_url()
     view = ContentViewsViewlet(self.portal, self.app.REQUEST, None)
     view.update()
     self.assertEqual(view.tabSet1[0]['id'], 'folderContents')
コード例 #3
0
ファイル: test_common.py プロジェクト: kkdhanesh/NBADEMO
 def testSet1OnPortalRoot(self):
     self._invalidateRequestMemoizations()
     self.loginAsPortalOwner()
     self.app.REQUEST['ACTUAL_URL'] = self.portal.absolute_url()
     view = ContentViewsViewlet(self.portal, self.app.REQUEST, None)
     view.update()
     self.assertEqual(view.tabSet1[0]['id'], 'folderContents')
コード例 #4
0
 def test_set1_on_portal_root(self):
     self._invalidateRequestMemoizations()
     setRoles(self.portal, TEST_USER_ID, ['Manager', 'Member'])
     self.app.REQUEST['ACTUAL_URL'] = self.portal.absolute_url()
     view = ContentViewsViewlet(self.portal, self.app.REQUEST, None)
     view.update()
     self.assertEqual(view.tabSet1[0]['id'], 'folderContents')
コード例 #5
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']])
コード例 #6
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']])
コード例 #7
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']])
コード例 #8
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']])
コード例 #9
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']])
コード例 #10
0
 def test_set1_NonStructuralFolder(self):
     self._invalidateRequestMemoizations()
     setRoles(self.portal, TEST_USER_ID, ['Manager', 'Member'])
     self.app.REQUEST['ACTUAL_URL'] = self.folder.absolute_url()
     directlyProvides(self.folder, INonStructuralFolder)
     view = ContentViewsViewlet(self.folder, self.app.REQUEST, None)
     view.update()
     noLongerProvides(self.folder, INonStructuralFolder)
     self.assertEqual(
         1, len([t for t in view.tabSet1 if t['id'] == 'folderContents']))
コード例 #11
0
ファイル: test_common.py プロジェクト: plone/plone.app.layout
 def test_set1_NonStructuralFolder(self):
     self._invalidateRequestMemoizations()
     setRoles(self.portal, TEST_USER_ID, ['Manager', 'Member'])
     self.app.REQUEST['ACTUAL_URL'] = self.folder.absolute_url()
     directlyProvides(self.folder, INonStructuralFolder)
     view = ContentViewsViewlet(self.folder, self.app.REQUEST, None)
     view.update()
     noLongerProvides(self.folder, INonStructuralFolder)
     self.assertEqual(1, len([t for t in view.tabSet1 if t[
                      'id'] == 'folderContents']))
コード例 #12
0
ファイル: test_common.py プロジェクト: kkdhanesh/NBADEMO
 def testSet1NonStructuralFolder(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)
     view.update()
     noLongerProvides(self.folder, INonStructuralFolder)
     self.assertEqual(1, len([t for t in view.tabSet1 if t[
                      'id'] == 'folderContents']))
コード例 #13
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']])
コード例 #14
0
 def testSet1NonStructuralFolder(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)
     view.update()
     noLongerProvides(self.folder, INonStructuralFolder)
     self.assertEqual(1, len([t for t in view.tabSet1 if t[
                      'id'] == 'folderContents']))
コード例 #15
0
 def test_set1(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)
     view.update()
     self.assertEqual(
         1, len([t for t in view.tabSet1 if t['id'] == 'folderContents']))
     self.assertEqual(['edit'],
                      [t['id'] for t in view.tabSet1 if t['selected']])
コード例 #16
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']])
コード例 #17
0
 def testSet1(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)
     view.update()
     self.assertEqual(1, len([t for t in view.tabSet1 if t[
                      'id'] == 'folderContents']))
     self.assertEqual(['edit'], [t['id'] for t in view.tabSet1 if t['selected']])