personal web log written by izabeera and dryobates

testing django splinter

Django splinter driver

by dryobates

Splinter is a great tool for testing web pages with python, but it lacked support for Django testing client. Today it has changed :)

Splinter is great in controlling browsers with python code. It can instruct browser (through selenium) to open page and behave like a normal user.

But spawning and instructing browser is slow. If most of code which you test\ndoesn't require JavaScript then you can use other driver: zope.browser. It is a little faster but still you have to run separate instance of webpage and do whole request through webserver. And if you have to mock some objects in code for separate test cases then the whole testing became difficult task.

There has been ticket with request for making driver for Django testing client\nfor over 3 years [1]. With in-process testing there's no problem with mocking and tests runs faster. It is now possible to run tests with Django test client and fall back to selenium-based drivers only for tests requiring JavaScript.

It is now available in master branch [2].

[1] Django testing client for Splinter
[2] Splinter
Jakub Stolarski. Software engineer. I work professionally as programmer since 2005. Speeding up software development with Test Driven Development, task automation and optimization for performance are things that focus my mind from my early career up to now. If you ask me for my religion: Python, Vim and FreeBSD are my trinity ;) Email:


Tag cloud