Ian Bicking: the old part of his blog

Re: Best of the web app test frameworks?

One feature that I really like, and that I haven't seen elsewhere is the fixture support found in RubyOnRails. This allows you to have a YAML file that loads data into your db for each test, and then removes it when the test is complete. Very helpful for testing models.

I haven't looked closely enough at paste to see if unit test stubs are autogenerated for models, controllers etc when the respective code is generated. That might be a nice touch too if you don't have it already.

Comment on Best of the web app test frameworks?
by Ed Summers


I did add something recently for loading data into SQLObject classes with a CSV file. However, actually populating a database for a test is a somewhat separate concern. Right now I'm doing that in some ad hoc setup_module() functions (which py.test invokes), but a complete stack should handle pulling all these things together.

I like having paster create templates build space for tests, but that this time I'm -0 on actually creating things for each controller and model. It seems excessive; I'd rather just add another function to a file. And I'd rather keep the boilerplate down, so that adding a test for a new controller just means:

def test_view():
    res = app.get('/view')

Which isn't something that needs generating, IMHO. (I do generate a test for app.get('/'), but that's more of an example than anything).

# Ian Bicking