Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
NuPlone.tests.testStyleInstallation.testUninstall Class Reference

List of all members.

Public Member Functions

def afterSetUp
def testProductUninstalled
def testSkinSelectionDeleted
def testDefaultSkinChanged
def testResetSkinFlexibility
def testResetCookiePersistance
def testStylesheetsUninstalled
def testResetDefaultStylesheets
def testJavascriptsUninstalled
def testResetDefaultJavascripts
def testDisplayViewsUnregistered

Public Attributes

 qitool
 skinstool
 csstool
 jstool
 stylesheets
 javascripts
 ttool

Detailed Description

Definition at line 120 of file testStyleInstallation.py.


Member Function Documentation

Test if .

Definition at line 122 of file testStyleInstallation.py.

00122 
00123     def afterSetUp(self):
00124         """Test if ."""
00125         self.qitool      = getattr(self.portal, 'portal_quickinstaller')
00126         self.skinstool   = getattr(self.portal, 'portal_skins')
00127         self.csstool     = getattr(self.portal, 'portal_css')
00128         self.jstool      = getattr(self.portal, 'portal_javascripts')
00129         product_settings = getattr(self.qitool, PROJECTNAME)
00130         self.stylesheets = product_settings.resources_css
00131         self.javascripts = product_settings.resources_js
00132         self.qitool.uninstallProducts(products=[PROJECTNAME])
00133         self.ttool = getattr(self.portal, 'portal_types')

Test if default skin is back to old value or default Plone.

Definition at line 144 of file testStyleInstallation.py.

00144 
00145     def testDefaultSkinChanged(self):
00146         """Test if default skin is back to old value or default Plone."""
00147         default_skin = self.skinstool.getDefaultSkin()
00148         if RESETSKINTOOL:
00149             self.assertEqual(default_skin, 'Plone Default')
00150         else:
00151             if DEFAULTSKIN:
00152                 for skin in SKINSELECTIONS:
00153                     if skin['name'] == DEFAULTSKIN:
00154                         self.assertEqual(default_skin, skin['base'])
00155             else:
00156                 self.assertEqual(default_skin, SKINSELECTIONS[0]['base'])

Make sure additional Display Views were removed

Definition at line 201 of file testStyleInstallation.py.

00201 
00202     def testDisplayViewsUnregistered(self):
00203         """Make sure additional Display Views were removed"""
00204         if DISPLAY_VIEWS:
00205             for pt, views in DISPLAY_VIEWS.items():
00206                 FTI = getattr(self.ttool, pt)
00207                 registered_views = FTI.view_methods
00208                 for view in views:
00209                     self.failIf(view in registered_views)

Test if added javascripts were removed from portal_js.

Definition at line 187 of file testStyleInstallation.py.

00187 
00188     def testJavascriptsUninstalled(self):
00189         """Test if added javascripts were removed from portal_js."""
00190         resourceids = self.jstool.getResourceIds()
00191         for js in self.javascripts:
00192             self.failIf(js in resourceids)

Test if the product was uninstalled.

Definition at line 134 of file testStyleInstallation.py.

00134 
00135     def testProductUninstalled(self):
00136         """Test if the product was uninstalled."""
00137         self.failIf(self.qitool.isProductInstalled(PROJECTNAME))

Test if the skin choice is still peristant between sessions.

Definition at line 165 of file testStyleInstallation.py.

00165 
00166     def testResetCookiePersistance(self):
00167         """Test if the skin choice is still peristant between sessions."""
00168         cookie_peristence = self.skinstool.getCookiePersistence()
00169         if RESETSKINTOOL:
00170             self.failIf(cookie_peristence)
00171         else:
00172             self.assertEqual(cookie_peristence, PERSISTENTCOOKIE)

Test if values were reverted in existing javascripts.

Definition at line 193 of file testStyleInstallation.py.

00193 
00194     def testResetDefaultJavascripts(self):
00195         """Test if values were reverted in existing javascripts."""
00196         for config in [c for c in JAVASCRIPTS
00197                        if c['id'] not in self.javascripts]:
00198             resource = self.jstool.getResource(config['id'])
00199             for key in [k for k in config.keys() if k != 'id']:
00200                 self.failIf(resource._data.has_key('original_'+key))

Test if values were reverted in existing stylesheets.

Definition at line 179 of file testStyleInstallation.py.

00179 
00180     def testResetDefaultStylesheets(self):
00181         """Test if values were reverted in existing stylesheets."""
00182         for config in [c for c in STYLESHEETS
00183                        if c['id'] not in self.stylesheets]:
00184             resource = self.csstool.getResource(config['id'])
00185             for key in [k for k in config.keys() if k != 'id']:
00186                 self.failIf(resource._data.has_key('original_'+key))

Test if the users still can choose their skin.

Definition at line 157 of file testStyleInstallation.py.

00157 
00158     def testResetSkinFlexibility(self):
00159         """Test if the users still can choose their skin."""
00160         allow_any = self.skinstool.getAllowAny()
00161         if RESETSKINTOOL:
00162             self.failIf(allow_any)
00163         else:
00164             self.assertEqual(allow_any, ALLOWSELECTION)

Test if the skin selection was removed from portal_skins.

Definition at line 138 of file testStyleInstallation.py.

00138 
00139     def testSkinSelectionDeleted(self):
00140         """Test if the skin selection was removed from portal_skins."""
00141         skin_selections = self.skinstool.getSkinSelections()
00142         for skin in SKINSELECTIONS:
00143             self.failIf(skin['name'] in skin_selections)

Test if added stylesheets were removed from portal_css.

Definition at line 173 of file testStyleInstallation.py.

00173 
00174     def testStylesheetsUninstalled(self):
00175         """Test if added stylesheets were removed from portal_css."""
00176         resourceids = self.csstool.getResourceIds()
00177         for css in self.stylesheets:
00178             self.failIf(css in resourceids)


Member Data Documentation

Definition at line 126 of file testStyleInstallation.py.

Definition at line 130 of file testStyleInstallation.py.

Definition at line 127 of file testStyleInstallation.py.

Definition at line 124 of file testStyleInstallation.py.

Definition at line 125 of file testStyleInstallation.py.

Definition at line 129 of file testStyleInstallation.py.

Definition at line 132 of file testStyleInstallation.py.


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