Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Public Attributes
plone.app.contentrules.tests.test_kss.KSSContentRulesTestCase Class Reference
Inheritance diagram for plone.app.contentrules.tests.test_kss.KSSContentRulesTestCase:
Inheritance graph
[legend]
Collaboration diagram for plone.app.contentrules.tests.test_kss.KSSContentRulesTestCase:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def test_instantiation
def test_replaceFilteredRulesForm
def loadCoreConfig
def createView
def setDebugRequest

Public Attributes

 view

Static Public Attributes

 layer = KSSAndPloneLayer

Detailed Description

Definition at line 9 of file test_kss.py.


Member Function Documentation

Definition at line 13 of file test_kss.py.

00013 
00014     def afterSetUp(self):
00015         self.setDebugRequest()
00016         self.setRoles(['Manager'])
00017         self.view = self.portal.restrictedTraverse('replaceRulesTable')

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 18 of file test_kss.py.

00018 
00019     def test_instantiation(self):
00020         view = self.view
00021         commands = view.getCommands()
00022         self.assertNotEquals(view, None)

Definition at line 23 of file test_kss.py.

00023 
00024     def test_replaceFilteredRulesForm(self):
00025         view = self.view
00026         commands = view.getCommands()
00027         res = view.replaceFilteredRulesForm(ruleType='state-enabled')
00028         # Adjust for different payload in newer kss versions
00029         html = res[0]['params']['html'].replace('<![CDATA[', '').replace(']]>', '')
00030         res[0]['params']['html'] = html
00031         self.assertEquals(res, [
00032             {'selectorType': '',    
00033              'params': {'html': u'\n<form style="display: inline" method="POST" id="rules_table_form" action="http://nohost/plone/@@rules-controlpanel">\n</form>\n', 
00034              'withKssSetup': u'True'}, 
00035              'name': 'replaceHTML', 
00036              'selector': '#rules_table_form'}
00037         ])


Member Data Documentation

Definition at line 11 of file test_kss.py.

Reimplemented from kss.core.tests.base.KSSViewTestCaseMixin.

Definition at line 16 of file test_kss.py.


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