[Erp5-dev] Dates divergency, even if dates are exact...

Yoshinori Okuji yo at nexedi.com
Tue Mar 18 09:37:35 CET 2008


On Tuesday 18 March 2008 09:16, Łukasz Nowak wrote:
> Hello,
>
> On 2008-03-17, 11:14:20
>
> Jean-Paul Smets <jp at nexedi.com> wrote:
> > Hi,
> >
> > Although this does not answer your exact question, I recommend for
> > divergency testing (ie. rules) to include some tolerance, both for
> > quantity and other values. I am not sure whether this is fully
> > implemented yet.
>
> Quite nice tip. So I shall modify code of proper AppliedRule subclass
> and add some date acceptance based on assumptions?
>
> But why is it only happens in unit tests? I wasn't able to reproduce it
> in production/development system. (The only problem is that, sometimes
> I've got to many test failures.) From other point of view - it only
> happens in my test suites, so I might broke something myself...

Most probably, because of a round error, since DateTime uses a floating point 
number internally. You should be able to see it in obj.__dict__. But if so, 
this was resolved by Alexandre some months ago. Look at a DateTime patch in 
ERP5Type.

YO
-- 
Yoshinori Okuji, Nexedi CTO
Nexedi: Consulting and Development of Free / Open Source Software
http://www.nexedi.com
ERP5: Full Featured High End Open Source ERP
http://www.erp5.com
ERP5 Wiki: Developer Zone for ERP5 Community
http://www.erp5.org



More information about the Erp5-dev mailing list