Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Writing tests for Django's admin actions

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?

like image 234
Achimnol Avatar asked Jun 16 '09 03:06

Achimnol


1 Answers

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/).

like image 120
Almad Avatar answered Oct 22 '22 02:10

Almad