Changeset 1588 in products


Ignore:
Timestamp:
Jan 26, 2010 2:22:34 PM (10 years ago)
Author:
mylan
Message:

Added tests of blacklists migration in importing/exporting portlets

Location:
quintagroup.transmogrifier/trunk/quintagroup/transmogrifier
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.transmogrifier/trunk/quintagroup/transmogrifier/portlets.txt

    r1585 r1588  
    7070    </property> 
    7171  </assignment> 
     72  <blacklist category="user" manager="plone.leftcolumn" status="block"/> 
     73  <blacklist category="group" manager="plone.leftcolumn" status="acquire"/> 
     74  <blacklist category="content_type" manager="plone.leftcolumn" status="acquire"/> 
     75  <blacklist category="context" manager="plone.leftcolumn" status="acquire"/> 
    7276</portlets> 
    7377<BLANKLINE> 
     
    9397    </property> 
    9498  </assignment> 
     99  <blacklist category="user" manager="plone.leftcolumn" status="block"/> 
     100  <blacklist category="group" manager="plone.leftcolumn" status="acquire"/> 
     101  <blacklist category="content_type" manager="plone.leftcolumn" status="acquire"/> 
     102  <blacklist category="context" manager="plone.leftcolumn" status="acquire"/> 
    95103</portlets> 
    96104<BLANKLINE> 
     
    106114>>> mapping['habra-rss'].timeout 
    107115120 
     116>>> 'rss' in mapping 
     117True 
     118>>> mapping['rss'].count 
     11910 
     120>>> mapping['rss'].url 
     121u'http://sumno.com/feeds/main-page/' 
     122>>> mapping['rss'].portlet_title 
     123u'RSS feed' 
     124>>> mapping['rss'].timeout 
     12560 
  • quintagroup.transmogrifier/trunk/quintagroup/transmogrifier/tests.py

    r1564 r1588  
    10891089    </property> 
    10901090  </assignment> 
     1091  <blacklist category="user" manager="plone.leftcolumn" status="block"/> 
     1092  <blacklist category="group" manager="plone.leftcolumn" status="acquire"/> 
     1093  <blacklist category="content_type" manager="plone.leftcolumn" status="acquire"/> 
     1094  <blacklist category="context" manager="plone.leftcolumn" status="acquire"/> 
    10911095</portlets> 
    10921096""") 
     
    11101114 
    11111115    from plone.app.portlets.assignable import localPortletAssignmentMappingAdapter 
     1116    from plone.portlets.assignable import LocalPortletAssignmentManager 
    11121117    from plone.app.portlets.interfaces import IPortletTypeInterface 
     1118    from plone.portlets.interfaces import  ILocalPortletAssignmentManager 
     1119    from plone.portlets.constants import USER_CATEGORY 
    11131120    # from plone.app.portlets.browser.interfaces import IPortletAdding 
    11141121    from plone.app.portlets.portlets.rss import IRSSPortlet, Assignment #, Renderer, AddForm, EditForm 
     
    11181125    provideUtility(manager, IPortletManager, name='plone.leftcolumn') 
    11191126    provideAdapter(localPortletAssignmentMappingAdapter) 
     1127    provideAdapter(LocalPortletAssignmentManager) 
    11201128    mapping = getMultiAdapter((portal, manager), IPortletAssignmentMapping) 
     1129    assignable = getMultiAdapter((portal, manager), ILocalPortletAssignmentManager) 
    11211130    test.globs['mapping'] = mapping 
     1131    test.globs['assignable'] = assignable 
    11221132 
    11231133    # register portlet (this is what plone:portlet zcml directive does) 
     
    11521162        field.validate(v) 
    11531163        field.set(assignment, v) 
     1164    # set blacklists for user category to 'block' 
     1165    assignable.setBlacklistStatus(USER_CATEGORY, True) 
    11541166 
    11551167def test_suite(): 
Note: See TracChangeset for help on using the changeset viewer.