This example is not tested...

Using ``.. doctest::`` is quite hard with Django examples, since they require custom setup (typically a Django project).

So one way to test Django code example is to include example from demo project. Something like:

```rst
.. literalinclude:: /../demo/demoproject/filter/forms.py
   :language: python
```

See http://sphinx-doc.org/markup/code.html#directive-literalinclude

Then, you can write tests for the demo project :)