Re: [Zope] Help writing test where bobobase_modification_time changes

2008-04-11 Thread Peter Bengtsson
Thanks for the tips Chris and Dieter, I actually solved it in a very simple way: from OFS.Image import File from time import time class MockFile(File): This file works the same as a normal File expect that in manage_edit() the internal modification time is set immediately. Normally

Re: [Zope] Help writing test where bobobase_modification_time changes

2008-04-10 Thread Chris Withers
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

Re: [Zope] Help writing test where bobobase_modification_time changes

2008-04-09 Thread Dieter Maurer
Peter Bengtsson wrote at 2008-4-8 19:08 +0100: ... The reason it fails on the last line is that the time difference between the first time and the second time is nil. Adding a time.sleep(1) won't change anything because the bobobase_modification_time() doesn't change. How can I solve this? Not