Django: Sane Testing is a Python library for the Django framework that makes it possible to test.
As much as I like some Django concepts and as much as authors embrace testing in official documentation, I doubt that anyone really tried them in detail. Some basic testing techniques are impossible with Django and this library comes to fix them.
One of the great flaws is very simplistic testing system. By it’s nature it’s very slow (flushing database when not needed [1]), it does not allow some basic xUnit features and also do not allow testing via HTTP [2] and provides to extensibility model to fix the issues.
However, there is an excellent option available. Nose library is excellent test-dicovery framework, backward-compatible with PyUnit, that provides nice plugin interface to hook your own stuff. To make my life simpler, most of this library is made as a nose plugin.
And don’t be afraid, we have TEST_RUNNER too, so your ./manage.py test will still work.
Library supports following:
Footnotes
[1] | At least transactional test cases are going to be implemented in Django 1.1, see #8138. |
[2] | Kinda buggy when we’re talking about HTTP framework. See #2879. |