Perhaps this can help. In your models:

if request.function == '_TEST':
   db = DAL('sqlite://testdb.sqlite')
else:
   db = DAL('sqlite://production.sqlite')


On Tuesday, 4 September 2012 12:08:26 UTC-5, Marek Mollin wrote:
>
> Hey,
> I really love testing in admin. I mean its out-of-thebox zero conf one 
> click doctesting. I love it.
> I dont have to get into massive unittest module(which is great, but for 
> differently scoped applications).
>
> However there is one thing I love in testRunner. The ability to replicate 
> a db and perform all operations with testing database. 
> I was wondering if there its an option to add it as deafult. I guess its a 
> safe convention to assume that you test things on cloned database.
>
> Right now I have to run testRunner solely for this purpose even though 
> doctest would suffice.
>
> I was outside patching web2py but this irritates me strongly enough so 
> that I might try to contribute.
> Just wondering if its an option or there is some backward-comp?
>

-- 



Reply via email to