On Thu, May 14, 2009 at 02:18:47PM +0000, Matthew Wilson wrote:
> I'm trying to write a test, but it seems like all the tests use a sqlite
> database, and sqlite doesn't support an interval datatype.
>
> Not sure what to do at this point. Here's the test (absolutely
> nothing fancy here):
>
> $ cat test_interval.py
> # vim: set expandtab ts=4 sw=4 filetype=python:
>
> from datetime import timedelta
>
> from sqlobject import *
> from sqlobject.tests.dbtest import *
>
> class Student(SQLObject):
> break_time = TimedeltaCol()
>
> def test_timedeltaCol():
> setupClass(Student)
> td = timedelta(seconds=60*60)
> student = Student(break_time=td)
> assert student.break_time == td
>
> When I run py.test test_interval.py, I get an operational error that
> comes from sqlite rejecting the interval syntax.
>
> Ideas? Should I create a postgresql database in my setup method and
> then connect to that for my test?
It should be something like
$ createdb test
$ py.test test_interval.py -D postgres:/test
$ dropdb test
Oleg.
--
Oleg Broytmann http://phd.pp.ru/ [email protected]
Programmers don't die, they just GOSUB without RETURN.
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss