On Wed 13 May 2009 04:35:59 PM EDT, Oleg Broytmann wrote:
> On Wed, May 13, 2009 at 08:05:26PM +0000, Matthew Wilson wrote:
>> >    IWBN to have a test also.
>> 
>> I completely agree; can you point me to where in the code I should write
>> the test?  Also, are there any tests I can use as a guide?
>
>    Any test script would be ok - I'll convert it to the test suit myself.
> But of course a test in SQLObject style would be even better.
>    SQLObject uses py.test as its testing environment. You can find a lot of
> tests in sqlobject/tests/ directory.


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?


------------------------------------------------------------------------------
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
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to