Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes
plone.app.kss.tests.test_menus.ContentActionMenusTestCase Class Reference
Inheritance diagram for plone.app.kss.tests.test_menus.ContentActionMenusTestCase:
Inheritance graph
[legend]
Collaboration diagram for plone.app.kss.tests.test_menus.ContentActionMenusTestCase:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def testReplaceContentRegion
def testChangeViewTemplate
def testKssCutObject
def testCutObject
def testKssCopyObject
def testCopyObject
def testChangeWorkflowState
def loadCoreConfig
def createView
def setDebugRequest

Public Attributes

 fpage
 view

Static Public Attributes

 layer = KSSAndPloneLayer

Detailed Description

Definition at line 27 of file test_menus.py.


Member Function Documentation

Definition at line 29 of file test_menus.py.

00029 
00030     def afterSetUp(self):
00031         KSSAndPloneTestCase.afterSetUp(self)
00032         self.setDebugRequest()
00033         self.loginAsPortalOwner()
00034         self.fpage = self.portal['front-page']

Here is the call graph for this function:

Definition at line 108 of file base.py.

00108 
00109     def createView(self):
00110         "Set up a fake view (with no content)"
00111         self.view = self.folder.restrictedTraverse('testMethod')
00112         return self.view

Here is the caller graph for this function:

def kss.core.tests.base.KSSViewTestCaseMixin.loadCoreConfig (   self,
  kss_core = True 
) [inherited]

Definition at line 102 of file base.py.

00102 
00103     def loadCoreConfig(self, kss_core=True):
00104         warnings.warn(
00105             "KSS tests are now using layers.  Please do not use "
00106             "loadCoreConfig anymore.",
00107             DeprecationWarning)
    

Definition at line 113 of file base.py.

00113 
00114     def setDebugRequest(self):
00115         'commands will be rendered as test friendly data structures'
00116         request = self.folder.REQUEST
00117         interface.directlyProvides(
00118             request,
00119             interface.directlyProvidedBy(request) + IDebugRequest)

Here is the caller graph for this function:

Definition at line 50 of file test_menus.py.

00050 
00051     def testChangeViewTemplate(self):
00052         # Let's set the default page on front-page,
00053         # should set default layout of portal
00054         req = self.portal.REQUEST
00055         self.assertEqual(self.portal.getLayout(), 'folder_listing')
00056         view = content_replacer.ContentMenuView(self.fpage, req)
00057         url = self.fpage.absolute_url() + '?templateId=atct_album_view'
00058         result = view.changeViewTemplate(url)
00059         self.assertEqual(self.portal.getLayout(), 'atct_album_view')
00060         
00061         resh = req.RESPONSE.headers
00062         self.assertEqual(resh['status'], '200 OK')
00063         self.failUnless(req.RESPONSE.cookies['statusmessages'].has_key('expires'), 'cookies not expired')

Definition at line 112 of file test_menus.py.

00112 
00113     def testChangeWorkflowState(self):
00114         # change the state of the front-page to published
00115         # I suppose to have the publish transition available
00116         req = self.portal.REQUEST
00117         view = content_replacer.ContentMenuView(self.fpage, req)
00118         url = self.fpage.absolute_url() + '/content_status_modify?workflow_action=publish'
00119         result = view.changeWorkflowState(url)
00120         self.assertEqual([(r['name'], r['selector'], r['selectorType']) for r in result],
00121                          [
00122                           ('replaceHTML', '.contentViews', 'css'),
00123                           ('replaceHTML', 'contentActionMenus', 'htmlid'),
00124                           ('setStyle', '.portalMessage', 'css'),
00125                           ('replaceInnerHTML', 'kssPortalMessage', 'htmlid'),
00126                           ('setAttribute', 'kssPortalMessage', 'htmlid'),
00127                           ('setStyle', 'kssPortalMessage', 'htmlid'),
00128                          ])

Definition at line 102 of file test_menus.py.

00102 
00103     def testCopyObject(self):
00104         req = self.portal.REQUEST
00105         self.failIf(req.RESPONSE.cookies.has_key('__cp'), 'has copy cookie')
00106         # XXX This menu is missing from front page, so we test them on the user folder.
00107         view = content_replacer.ContentMenuView(self.folder, req)
00108         result = view.copyObject()
00109         resh = req.RESPONSE.headers
00110         self.assertEqual(resh['status'], '200 OK')
00111         self.failUnless(req.RESPONSE.cookies.has_key('__cp'), 'no copy cookies')

Here is the call graph for this function:

Definition at line 78 of file test_menus.py.

00078 
00079     def testCutObject(self):
00080         req = self.portal.REQUEST
00081         self.failIf(req.RESPONSE.cookies.has_key('__cp'), 'has cut cookie')
00082         # XXX This menu is missing from front page, so we test them on the user folder.
00083         view = content_replacer.ContentMenuView(self.folder, req)
00084         result = view.cutObject()
00085         resh = req.RESPONSE.headers
00086         self.assertEqual(resh['status'], '200 OK')
00087         self.failUnless(req.RESPONSE.cookies.has_key('__cp'), 'no cut cookie')
        

Here is the call graph for this function:

Definition at line 88 of file test_menus.py.

00088 
00089     def testKssCopyObject(self):
00090         req = self.portal.REQUEST
00091         # XXX This menu is missing from front page, so we test them on the user folder.
00092         view = content_replacer.ContentMenuView(self.folder, req)
00093 
00094         result = view.copyObject()
00095         self.assertEqual([(r['name'], r['selector'], r['selectorType']) for r in result],
00096                          [('replaceHTML', 'contentActionMenus', 'htmlid'),
00097                           ('setStyle', '.portalMessage', 'css'),
00098                           ('replaceInnerHTML', 'kssPortalMessage', 'htmlid'),
00099                           ('setAttribute', 'kssPortalMessage', 'htmlid'),
00100                           ('setStyle', 'kssPortalMessage', 'htmlid'),
00101                          ])

Here is the call graph for this function:

Definition at line 64 of file test_menus.py.

00064 
00065     def testKssCutObject(self):
00066         req = self.portal.REQUEST
00067         # XXX This menu is missing from front page, so we test them on the user folder.
00068         view = content_replacer.ContentMenuView(self.folder, req)
00069         result = view.cutObject()
00070 
00071         self.assertEqual([(r['name'], r['selector'], r['selectorType']) for r in result],
00072                          [('replaceHTML', 'contentActionMenus', 'htmlid'),
00073                           ('setStyle', '.portalMessage', 'css'),
00074                           ('replaceInnerHTML', 'kssPortalMessage', 'htmlid'),
00075                           ('setAttribute', 'kssPortalMessage', 'htmlid'),
00076                           ('setStyle', 'kssPortalMessage', 'htmlid'),
00077                          ])

Here is the call graph for this function:

Definition at line 39 of file test_menus.py.

00039 
00040     def testReplaceContentRegion(self):
00041         req = self.portal.REQUEST
00042         view = content_replacer.ContentView(self.fpage, req)
00043         result = view.replaceContentRegion(self.fpage.absolute_url(), tabid='contentview-edit')
00044         self.assertEqual([(r['name'], r['selector'], r['selectorType']) for r in result],
00045                          [('replaceHTML', 'region-content', 'htmlid'),
00046                           ('setAttribute', 'ul.contentViews li', 'css'),
00047                           ('setAttribute', 'contentview-edit', 'htmlid'),
00048                           ('replaceHTML', 'contentActionMenus', 'htmlid'),
00049                          ])


Member Data Documentation

Definition at line 33 of file test_menus.py.

Definition at line 25 of file kss_and_plone_layer.py.


The documentation for this class was generated from the following file: