Exemple #1
0
 def testDefaultPageIncludesParentAndItemViewsWhenItemHasMultipleViews(self):  # noqa
     fti = self.portal.portal_types['Document']
     if self.is_dx:
         documentViews = fti.view_methods + ('content-core',)
         set_browserlayer(self.request)
     else:
         documentViews = fti.view_methods + ('base_view',)
     fti.manage_changeProperties(view_methods=documentViews)
     self.folder.invokeFactory('Document', 'doc1')
     self.folder.setDefaultPage('doc1')
     actions = self.menu.getMenuItems(self.folder.doc1, self.request)
     self.assertIn(
         'folderDefaultPageDisplay',
         [a['extra']['id'] for a in actions]
     )
     self.assertIn(
         'plone-contentmenu-display-document_view',
         [a['extra']['id'] for a in actions]
     )
     if self.is_dx:
         self.assertIn(
             'plone-contentmenu-display-content-core',
             [a['extra']['id'] for a in actions]
         )
     else:
         self.assertIn(
             'plone-contentmenu-display-base_view',
             [a['extra']['id'] for a in actions]
         )
 def testSingleTemplateIncluded(self):
     self.folder.invokeFactory('Document', 'doc1')
     if self.is_dx:
         set_browserlayer(self.request)
     actions = self.menu.getMenuItems(self.folder.doc1, self.request)
     self.assertEqual(len(actions), 1)
     self.assertEqual(actions[0]['extra']['id'], 'plone-contentmenu-display-document_view')
Exemple #3
0
 def testDefaultPageIncludesParentAndItemViewsWhenItemHasMultipleViews(self):  # noqa
     fti = self.portal.portal_types['Document']
     if self.is_dx:
         documentViews = fti.view_methods + ('content-core',)
         set_browserlayer(self.request)
     else:
         documentViews = fti.view_methods + ('base_view',)
     fti.manage_changeProperties(view_methods=documentViews)
     self.folder.invokeFactory('Document', 'doc1')
     self.folder.setDefaultPage('doc1')
     actions = self.menu.getMenuItems(self.folder.doc1, self.request)
     self.assertIn(
         'folderDefaultPageDisplay',
         [a['extra']['id'] for a in actions]
     )
     self.assertIn(
         'plone-contentmenu-display-document_view',
         [a['extra']['id'] for a in actions]
     )
     if self.is_dx:
         self.assertIn(
             'plone-contentmenu-display-content-core',
             [a['extra']['id'] for a in actions]
         )
     else:
         self.assertIn(
             'plone-contentmenu-display-base_view',
             [a['extra']['id'] for a in actions]
         )
Exemple #4
0
 def setUp(self):
     self.portal = self.layer['portal']
     self.portal.invokeFactory('Folder', 'folder')
     self.folder = self.portal['folder']
     self.request = self.layer['request']
     set_browserlayer(self.request)
     self.menu = getUtility(IBrowserMenu, 'plone_displayviews')
Exemple #5
0
 def testSingleTemplateIncluded(self):
     self.folder.invokeFactory('Document', 'doc1')
     if self.is_dx:
         set_browserlayer(self.request)
     actions = self.menu.getMenuItems(self.folder.doc1, self.request)
     self.assertEqual(len(actions), 1)
     self.assertEqual(actions[0]['extra']['id'],
                      'plone-contentmenu-display-document_view')
Exemple #6
0
 def testSeparatorsNotIncludedWhenViewingDefaultPageWithoutViews(self):
     self.folder.invokeFactory('Document', 'doc1')
     self.folder.setDefaultPage('doc1')
     if self.is_dx:
         set_browserlayer(self.request)
     self.assertEqual(len(self.folder.doc1.getAvailableLayouts()), 1)
     actions = self.menu.getMenuItems(self.folder.doc1, self.request)
     ids = [a['extra']['id'] for a in actions]
     self.assertFalse('folderHeader' in ids)
     self.assertFalse('contextHeader' in ids)
Exemple #7
0
 def testSeparatorsNotIncludedWhenViewingDefaultPageWithoutViews(self):
     self.folder.invokeFactory('Document', 'doc1')
     self.folder.setDefaultPage('doc1')
     if self.is_dx:
         set_browserlayer(self.request)
     self.assertEqual(len(self.folder.doc1.getAvailableLayouts()), 1)
     actions = self.menu.getMenuItems(self.folder.doc1, self.request)
     ids = [a['extra']['id'] for a in actions]
     self.assertFalse('folderHeader' in ids)
     self.assertFalse('contextHeader' in ids)
 def setUp(self):
     self.portal = self.layer['portal']
     self.request = self.layer['request']
     set_browserlayer(self.request)
     setRoles(self.portal, TEST_USER_ID, ['Manager'])
     login(self.portal, TEST_USER_NAME)
     self.portal.invokeFactory('Folder', 'test-folder')
     self.folder = self.portal['test-folder']
     self.folder.invokeFactory('Collection', 'collection1')
     self.collection = aq_inner(self.folder['collection1'])
     self.request.set('URL', self.collection.absolute_url())
     self.request.set('ACTUAL_URL', self.collection.absolute_url())
Exemple #9
0
 def testSeparatorsIncludedWhenViewingDefaultPageWithViews(self):
     fti = self.portal.portal_types['Document']
     if self.is_dx:
         documentViews = fti.view_methods + ('content-core',)
         set_browserlayer(self.request)
     else:
         documentViews = fti.view_methods + ('base_view',)
     fti.manage_changeProperties(view_methods=documentViews)
     self.folder.invokeFactory('Document', 'doc1')
     self.folder.setDefaultPage('doc1')
     actions = self.menu.getMenuItems(self.folder.doc1, self.request)
     ids = [a['extra']['id'] for a in actions]
     self.assertTrue('folderHeader' in ids)
     self.assertTrue('contextHeader' in ids)
 def setUp(self):
     self.browser = Browser(self.layer['app'])
     self.portal = self.layer['portal']
     self.request = self.layer['request']
     set_browserlayer(self.request)
     setRoles(self.portal, TEST_USER_ID, ['Manager'])
     login(self.portal, TEST_USER_NAME)
     self.portal.invokeFactory('Folder', 'test-folder')
     self.folder = self.portal['test-folder']
     self.folder.invokeFactory('Collection',
                               'collection1')
     self.collection = aq_inner(self.folder['collection1'])
     self.request.set('URL', self.collection.absolute_url())
     self.request.set('ACTUAL_URL', self.collection.absolute_url())
Exemple #11
0
 def testSeparatorsIncludedWhenViewingDefaultPageWithViews(self):
     fti = self.portal.portal_types['Document']
     if self.is_dx:
         documentViews = fti.view_methods + ('content-core', )
         set_browserlayer(self.request)
     else:
         documentViews = fti.view_methods + ('base_view', )
     fti.manage_changeProperties(view_methods=documentViews)
     self.folder.invokeFactory('Document', 'doc1')
     self.folder.setDefaultPage('doc1')
     actions = self.menu.getMenuItems(self.folder.doc1, self.request)
     ids = [a['extra']['id'] for a in actions]
     self.assertTrue('folderHeader' in ids)
     self.assertTrue('contextHeader' in ids)
Exemple #12
0
 def setUp(self):
     super(TestContentMenuDX, self).setUp()
     set_browserlayer(self.request)
Exemple #13
0
 def setUp(self):
     super(TestDisplayMenuDX, self).setUp()
     set_browserlayer(self.request)
Exemple #14
0
 def setUp(self):
     super(TestContentMenuDX, self).setUp()
     set_browserlayer(self.request)
Exemple #15
0
 def setUp(self):
     super(TestManagePortletsMenuDX, self).setUp()
     set_browserlayer(self.request)
Exemple #16
0
 def setUp(self):
     super(TestWorkflowMenuDX, self).setUp()
     set_browserlayer(self.request)
Exemple #17
0
 def setUp(self):
     super(TestActionsMenuDX, self).setUp()
     set_browserlayer(self.request)
Exemple #18
0
 def setUp(self):
     super(TestFactoriesMenuDX, self).setUp()
     set_browserlayer(self.request)
Exemple #19
0
 def setUp(self):
     super(TestDisplayMenuDX, self).setUp()
     set_browserlayer(self.request)
Exemple #20
0
 def setUp(self):
     super(TestFactoriesMenuDX, self).setUp()
     set_browserlayer(self.request)
Exemple #21
0
 def setUp(self):
     super(TestActionsMenuDX, self).setUp()
     set_browserlayer(self.request)
Exemple #22
0
 def setUp(self):
     super(TestWorkflowMenuDX, self).setUp()
     set_browserlayer(self.request)
Exemple #23
0
 def setUp(self):
     super(TestManagePortletsMenuDX, self).setUp()
     set_browserlayer(self.request)