Thanks, this worked for me.
In my case I wanted to do the tests in a clone of the original, so the data
was there previously. Still I had problems with the migrations in web2py
until I used this parameters:
if request.function == '_TEST':
workdb = DAL('postgres://user:password@localhost/testdb',check_reserved
=['all'], lazy_tables=False, migrate=True, fake_migrate=True,
fake_migrate_all=True)
else:
workdb = DAL('postgres://user:password@localhost/productiondb',
check_reserved=['all'], lazy_tables=True)
On Wednesday, 2 March 2011 01:19:04 UTC, Santiago wrote:
>
> Hello,
>
> We need to create unit tests for accions that access the database.
> Does web2py provide tools to do this? The idea is to have a test
> purpose database and populate it with test data at the moment the
> tests run. Then, the test would use this fake data populated in the
> database.
>
> Thanks in advance
> Santiago
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.