Ignore:
Timestamp:
Nov 17, 2009 7:23:49 AM (14 years ago)
Author:
piv
Message:

merge from 2.1 branch, this adds flushcache section

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.transmogrifier/trunk/quintagroup/transmogrifier/tests.py

    r706 r1381  
    927927    test.globs['transmogrifier'].context = test.globs['plone'] 
    928928 
     929def flushCacheSetUp(test): 
     930    sectionsSetUp(test) 
     931     
     932    class DataBase(object): 
     933        def __init__(self, context): 
     934            self.context = context 
     935         
     936        def cacheMinimize(self): 
     937            self.context.cacheMinimized += 1 
     938 
     939        def _getDB(self): 
     940            return self 
     941     
     942    class DataBasePanel(object): 
     943        def __init__(self, context): 
     944            self.context = context 
     945         
     946        def getDatabaseNames(self): 
     947            return ('main',) 
     948         
     949        def __getitem__(self, key): 
     950            return DataBase(self.context) 
     951     
     952    class ControlPanel(object): 
     953        def __init__(self, context): 
     954            self.Database = DataBasePanel(context) 
     955     
     956    class MockPortal(object): 
     957        def __init__(self): 
     958            self.cacheMinimized = 0 
     959            self.Control_Panel = ControlPanel(self) 
     960         
     961    test.globs['plone'] = MockPortal() 
     962    test.globs['transmogrifier'].context = test.globs['plone'] 
     963 
    929964def test_suite(): 
    930965    import sys 
     
    9671002            'catalogsource.txt', 
    9681003            setUp=catalogSourceSetUp, tearDown=tearDown), 
     1004        doctest.DocFileSuite( 
     1005            'flushcache.txt', 
     1006            setUp=flushCacheSetUp, tearDown=tearDown), 
    9691007    )) 
    9701008    return suite 
Note: See TracChangeset for help on using the changeset viewer.