Back to index

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

List of all members.

Public Member Functions

def test_notLogged
def test_logged

Detailed Description

Definition at line 24 of file test_kss_attributes.py.


Member Function Documentation

Definition at line 60 of file test_kss_attributes.py.

00060 
00061     def test_logged():
00062         r"""
00063         
00064         Okay, we don't go straight away for the page but we actually
00065         do authenticate
00066         
00067             >>> self.browser.addHeader(
00068             ...    'Authorization', 'Basic %s:%s' % (self.user, self.password))
00069             >>> self.browser.open(self.page.absolute_url())
00070             >>> soup = self.BeautifulSoup(self.browser.contents)
00071         
00072         We find the title
00073         
00074             >>> title = soup.find(id='parent-fieldname-title')
00075             >>> title is not None
00076             True
00077         
00078         We check everything is in now, especially that
00079         ``kssattr-fieldname-`` matched the right field, and is not
00080         only there, but actually makes some sense
00081         Also, we check that the class is ``inlineEditable`` because our KSS
00082         hooks there (look at at.kss for details)
00083         
00084             >>> 'kssattr-atfieldname-title' in title['class']
00085             True
00086             >>> 'kssattr-templateId-' in title['class']
00087             True
00088             >>> 'kssattr-macro-' in title['class']
00089             True
00090             >>> 'inlineEditable' in title['class']
00091             True
00092 
00093         Rerun, description now! (which is not a Francis Ford Coppola's
00094         movie)
00095         
00096             >>> description = soup.find(
00097             ...    id='parent-fieldname-description')
00098             >>> description is not None
00099             True
00100             >>> 'kssattr-atfieldname-description' in description['class']
00101             True
00102             >>> 'kssattr-templateId-' in description['class']
00103             True
00104             >>> 'kssattr-macro-' in description['class']
00105             True
00106             >>> 'inlineEditable' in description['class']
00107             True
00108         
00109         Now, time for the text
00110         
00111             >>> text = soup.find(id='parent-fieldname-text')
00112             >>> text is not None
00113             True
00114             >>> 'kssattr-atfieldname-text' in text['class']
00115             True
00116             >>> 'kssattr-templateId-' in text['class']
00117             True
00118             >>> 'kssattr-macro-' in text['class']
00119             True
00120             >>> 'inlineEditable' in text['class']
00121             True
00122         """

Definition at line 26 of file test_kss_attributes.py.

00026 
00027     def test_notLogged():
00028         r"""
00029        
00030         We publish the page.
00031 
00032             >>> self.portal.portal_workflow.doActionFor(self.page, 'submit')
00033             >>> self.loginAsPortalOwner()
00034             >>> self.portal.portal_workflow.doActionFor(self.page, 'publish')
00035             >>> self.logout()
00036 
00037         We call it.
00038         
00039             >>> self.browser.open(self.page.absolute_url())
00040             >>> soup = self.BeautifulSoup(self.browser.contents)
00041         
00042         We find the title tag.
00043         
00044             >>> title = soup.find(id='parent-fieldname-title')
00045             >>> title is not None
00046             True
00047         
00048         We see that the KSS hooks shouldn't be there because we're not
00049         logged in!
00050         
00051             >>> 'kssattr-atfieldname-' in title['class']
00052             False
00053             >>> 'kssattr-templateId-' in title['class']
00054             False
00055             >>> 'kssattr-macro-' in title['class']
00056             False
00057             >>> 'inlineEditable' in title['class']
00058             False
00059         """


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