Update of /cvsroot/webware/Webware/MiddleKit/Tests/MKDateTime.mkmodel
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7754/MKDateTime.mkmodel
Modified Files:
TestSamples.py
Log Message:
- Fix test for time and timedeltas.
- Delete some unused code.
Index: TestSamples.py
===================================================================
RCS file: /cvsroot/webware/Webware/MiddleKit/Tests/MKDateTime.mkmodel/TestSamples.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** TestSamples.py 20 Feb 2005 02:25:49 -0000 1.5
--- TestSamples.py 20 Feb 2005 02:55:44 -0000 1.6
***************
*** 4,19 ****
f = store.fetchObjectsOfClass(Foo)[0]
- d = '2000-01-01'
- t = '13:01'
- dt = '2000-01-01 13:01'
- try:
- from mx.DateTime import DateTimeFrom, DateTimeDeltaFrom
- print 'Testing with DateTime module.'
- d = DateTimeFrom(d)
- t = DateTimeDeltaFrom(t)
- dt = DateTimeFrom(dt)
- except ImportError:
- print 'Testing with strings.'
-
from MiddleKit.Design.PythonGenerator import nativeDateTime, mxDateTime
--- 4,7 ----
***************
*** 30,36 ****
if nativeDateTime:
match = value==store.filterDateTimeDelta(nativeDateTime.time(13, 01))
if not match and mxDateTime:
match = value==mxDateTime.DateTimeDeltaFrom('13:01')
! assert match, value
value = f.dt()
--- 18,26 ----
if nativeDateTime:
match = value==store.filterDateTimeDelta(nativeDateTime.time(13, 01))
+ if not match:
+ match = value==nativeDateTime.timedelta(hours=13, minutes=01)
if not match and mxDateTime:
match = value==mxDateTime.DateTimeDeltaFrom('13:01')
! assert match, '%s, %s' % (value, type(value))
value = f.dt()
|