[Zope] Help writing test where bobobase_modification_time changes

Chris Withers chris at simplistix.co.uk
Thu Apr 10 04:09:51 EDT 2008


Peter Bengtsson wrote:
> How can I solve this? Make one big transaction two without having to
> use transaction.get().commit() which I don't think I can use in unit
> tests as per Dieter's advice.

I'd suggest monkeypatching bobobase_modification_time on the objects 
you're testing with. You're testing your cache code, not the 
implementation of those objects, so replacing them with (partially) 
dummy objects is great for avoiding this kind of problem and is a 
pattern I've used frequently...

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk


More information about the Zope mailing list