Changeset 1895 in products


Ignore:
Timestamp:
Mar 11, 2010 8:25:05 PM (10 years ago)
Author:
mylan
Message:

#161: Fix doctests and update browser.txt

Location:
quintagroup.seoptimizer/branches/refactoring2.3.0/quintagroup/seoptimizer/tests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.seoptimizer/branches/refactoring2.3.0/quintagroup/seoptimizer/tests/browser.txt

    r1849 r1895  
    5353=============================== 
    5454 
    55     >>> self.qi = self.portal.portal_quickinstaller 
    56     >>> self.sp = self.portal.portal_properties.seo_properties 
    57     >>> self.object_tabs = self.portal.portal_actions.object 
    58     >>> self.ps = self.portal.portal_setup 
     55Define some general objects: 
    5956 
    60 First uninstall product, if it is already installed: 
     57    >>> qi = self.portal.portal_quickinstaller 
     58    >>> object_tabs = self.portal.portal_actions.object 
     59    >>> ps = self.portal.portal_setup 
    6160 
    62     >>> from quintagroup.seoptimizer.config import PROJECT_NAME 
    63     >>> if self.qi.isProductInstalled(PROJECT_NAME): 
    64     ...     self.qi.uninstallProducts([PROJECT_NAME,]) 
    65  
    66  
    67 Test installation 'SEO Properties' action 
     61Test is 'SEO Properties' action present for a Page before 
     62seoptimizer installed 
    6863 
    6964    >>> browser.open('http://nohost/plone/front-page') 
    7065    >>> "SEO Properties" in browser.contents 
    7166    False 
    72     >>> self.qi.installProduct(PROJECT_NAME) 
     67 
     68Now install the product for following testing, and add 
     69 
     70    >>> qi.installProduct(PROJECT_NAME) 
    7371    'Ran all install steps.' 
    74     >>> self.portal.portal_actions.object.get('SEOProperties', None) is not None 
     72    >>> sp = self.portal.portal_properties.seo_properties 
     73 
     74And check is SEOProperties added to object tabs 
     75  
     76   >>> object_tabs.get('SEOProperties', None) is not None 
    7577    True 
    7678 
    7779Test visibility 'SEO Properties' action after installation 
    7880 
    79     >>> self.sp.content_types_with_seoproperties = ('Document',) 
     81    >>> sp.content_types_with_seoproperties = ('Document',) 
    8082    >>> browser.open('http://nohost/plone/front-page') 
    8183    >>> "SEO Properties" in browser.contents 
     
    8688Test invisibility 'SEO Properties' action after installation 
    8789 
    88     >>> self.sp.content_types_with_seoproperties = ('File',) 
     90    >>> sp.content_types_with_seoproperties = ('File',) 
    8991    >>> browser.open('http://nohost/plone/front-page') 
    9092    >>> "SEO Properties" in browser.contents 
     
    9799    >>> "SEO Properties" in browser.contents 
    98100    False 
    99     >>> self.ps.setLastVersionForProfile('quintagroup.seoptimizer:default', '2.0.0') 
    100     >>> self.qi.reinstallProducts((PROJECT_NAME,)) 
     101    >>> ps.setLastVersionForProfile('quintagroup.seoptimizer:default', '2.0.0') 
     102    >>> qi.reinstallProducts((PROJECT_NAME,)) 
    101103    >>> self.portal.portal_actions.object.get('SEOProperties', None) is not None 
    102104    True 
     
    104106Test visibility 'SEO Properties' action after reinstallation 
    105107 
    106     >>> self.sp.content_types_with_seoproperties = ('Document',) 
     108    >>> sp.content_types_with_seoproperties = ('Document',) 
    107109    >>> browser.open('http://nohost/plone/front-page') 
    108110    >>> "SEO Properties" in browser.contents 
     
    113115Test invisibility 'SEO Properties' action after reinstallation 
    114116 
    115     >>> self.sp.content_types_with_seoproperties = ('File',) 
     117    >>> sp.content_types_with_seoproperties = ('File',) 
    116118    >>> browser.open('http://nohost/plone/front-page') 
    117119    >>> "SEO Properties" in browser.contents 
     
    120122Test uninstallation 'SEO Properties' action 
    121123 
    122     >>> self.sp.content_types_with_seoproperties = ('Document',) 
     124    >>> sp.content_types_with_seoproperties = ('Document',) 
    123125    >>> browser.open('http://nohost/plone/front-page') 
    124126    >>> "SEO Properties" in browser.contents 
    125127    True 
    126     >>> self.qi.uninstallProducts((PROJECT_NAME,)) 
    127     >>> self.portal.portal_actions.object.get('SEOProperties', None) is not None 
     128    >>> qi.uninstallProducts((PROJECT_NAME,)) 
     129    >>> object_tabs.get('SEOProperties', None) is not None 
    128130    False 
    129131 
    130132Test visibility 'SEO Properties' action after uninstallation 
    131133 
    132     >>> self.sp.content_types_with_seoproperties = ('Document',) 
     134    >>> sp.content_types_with_seoproperties = ('Document',) 
    133135    >>> browser.open('http://nohost/plone/front-page') 
    134136    >>> "SEO Properties" in browser.contents 
  • quintagroup.seoptimizer/branches/refactoring2.3.0/quintagroup/seoptimizer/tests/test_doctest.py

    r1834 r1895  
    55from zope.component import testing, eventtesting 
    66 
    7 from Testing import ZopeTestCase as ztc 
    8  
    9 from quintagroup.seoptimizer.tests import base 
     7from base import * 
    108 
    119def test_suite(): 
     
    1513        ztc.FunctionalDocFileSuite( 
    1614            'browser.txt', package='quintagroup.seoptimizer.tests', 
    17             test_class=base.FunctionalTestCase, 
     15            test_class=FunctionalTestCaseNotInstalled, globs=globals(), 
    1816            optionflags=doctest.REPORT_ONLY_FIRST_FAILURE | 
    1917                doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS), 
Note: See TracChangeset for help on using the changeset viewer.