[ckan-dev] Testing: a helper?

Toby Dacre toby.okfn at gmail.com
Mon Mar 4 12:49:59 UTC 2013


I've been looking at the tests as I need to write a few.  Here is a
possible approach, after some previous feedback

https://gist.github.com/tobes/5081840

The idea is to have a testing helper that means that we can write
simpler tests more resistant tests.  Also having simple test classes
not inheriting seems to be a good idea as trying to understand which
code was being called did get complicated and some things got secretly
cached which were hard to find.

Currently things like the create test data just stuff things into the
database rather than going through logic actions so the data may not
match what would actually created.
Also many tests are having to worry about creating the app and doing
things like changing the config - this can all be simplified.

Sean has suggested that this should be not a class but rather a bunch
of helper functions - this could be done but then tests would need to
ensure that things were reset but this would be a minor issue.

It would be good to get more feedback on this.

Tobes




More information about the ckan-dev mailing list