Back to index

plone3  3.1.7
Public Member Functions
plone.app.kss.tests.test_kss_attributes.TestContentMenu Class Reference

List of all members.

Public Member Functions

def test_menu_presence

Detailed Description

Definition at line 171 of file test_kss_attributes.py.


Member Function Documentation

Definition at line 172 of file test_kss_attributes.py.

00172 
00173     def test_menu_presence():
00174         r"""
00175         We must authenticate because content menu is only present for logged in users
00176         
00177             >>> self.browser.addHeader(
00178             ...  'Authorization', 'Basic %s:%s' % (self.user, self.password))
00179             >>> self.browser.open(self.page.absolute_url())
00180             >>> soup = self.BeautifulSoup(self.browser.contents)
00181           
00182         We are in a page so we must have the "change workflow" menu.
00183         
00184             >>> contentmenu_dl_tag = soup.find('dl', {'id':'plone-contentmenu-workflow'})
00185             >>> contentmenu_dl_tag is not None
00186             True
00187 
00188             >>> contentmenu_dl_tag.find('dd',{'class':'actionMenuContent'}) is not None
00189             True  
00190           
00191         Then you must have the copy and cut links
00192         
00193             >>> soup.find('a', {'class':'actionicon-object_buttons-cut'}) is not None
00194             True
00195             
00196             >>> soup.find('a', {'class':'actionicon-object_buttons-copy'}) is not None
00197             True
00198         
00199         Now we go to the folder, so we must have the "change view" menu.
00200             
00201             >>> self.browser.open(self.folder.absolute_url())
00202             >>> soup = self.BeautifulSoup(self.browser.contents)    
00203             >>> contentmenu_dl_tag = soup.find('dl', {'id':'plone-contentmenu-display'})
00204             >>> contentmenu_dl_tag is not None
00205             True
00206 
00207             >>> contentmenu_dl_tag.find('dd',{'class':'actionMenuContent'}) is not None
00208             True
00209           
00210         A couple of things again, basically the stuff we hook on with kss, which are, the 
00211         external div and the inner ul (one is used for content replacement through innerHTML,
00212         the other used to hook events on load)
00213             
00214             >>> self.browser.open(self.folder.absolute_url())
00215             >>> soup = self.BeautifulSoup(self.browser.contents)
00216             
00217         Ok let's see if we have the hook to replace the content
00218             
00219             >>> content_td = soup.find('td', {'id': 'portal-column-content'})
00220             >>> content_td is not None
00221             True
00222             >>> content_actions = content_td.find('div', {'class': 'contentActions'})
00223             >>> content_actions is not None
00224             True
00225             
00226         This is great, now let's check if we have the bind load stuff in place too
00227             
00228             >>> content_actions_ul = content_actions.find('ul', {'id': 'contentActionMenus'})
00229             >>> content_actions_ul is not None
00230             True
00231 
00232         """


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