testing schevo+pylons apps
Posted by gldnspud on the 6th of December, 2006 at 2:17 pm under Uncategorized. This post has no comments.Note: This is based on a development version of the SchevoWsgi package.
I needed a way to get to an in-memory Schevo database that would be created from scratch every time a functional unit test ran in a Pylons application.
So I added a memory:// URI type to SchevoWsgi's dbopener middleware.
To use it in a Pylons application, make sure you already have a development.ini file that is designed to work with Schevo. Then copy it to testing.ini and change the [filter:dbopener] section to use an in-memory database instead:
[filter:dbopener] use = egg:SchevoWsgi#dbopener schevo.db.db = memory://yourapp.schema/1 verbose = true
Change the loadapp line in yourapp/tests/__init__.py to read as follows:
loadapp('config:testing.ini', relative_to=conf_dir)
Submit Comment