I'm using Django 1.1 beta and hoping to use admin actions. I have to write unit tests for those, but I don't get it how to write tests for them.
For normal view handler functions, I can use Django's TestClient to simulate http request/response, but how should it be done with admin actions?
Testing django admin is currently pain, because of admin's tight coupling. AFAIK, You can still use request/response, but I gave up and use only functional tests (Selenium, but you can use Windmill as well) and unit testing only our admin extensions.
There is a GSoC project for covering admin with Windmill tests, and windmill is now featuring plugin for Django integration.
If You're more interested in Selenium, I've written integration library for it, too (http://devel.almad.net/trac/django-sane-testing/).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With