[OH-Dev] [issue1028] Adjust our "twill tests" to either use Django's test client directly, or use django-webtest
Asheesh Laroia
bugs at openhatch.org
Mon Aug 4 02:13:37 UTC 2014
New submission from Asheesh Laroia <asheesh at asheesh.org>:
Right now, we use Twill, a mini fake Python web browser, for some of our tests.
This is convenient, but has some downsides:
* twill is seemingly unmaintained.
* This is a pretty non-standard thing to do. Therefore, we're likely to run into
issues that other projects don't run into. (For example, it seems that maybe our
Twill<->Django integration stopped working, as of Django 1.5? Not sure.)
We use Twill for its browser-like conveniences -- specifically, in the tests, we
can use a very simple API for filling out web forms and submitting them.
Luckily, django-webtest <https://github.com/kmike/django-webtest> also provides
a very clean API that seems to be as expressive as the Twill one.
It'd be great to see someone take this on as a backend refactoring task. I'd be
very happy to help mentor someone, if they want to do, and could remote pair-
program to some extent on this, too.
References:
* https://djangosnippets.org/snippets/665/
* https://pythonhosted.org/django-test-utils/twill_runner.html
* https://pypi.python.org/pypi/django-webtest
* http://twill.idyll.org/
Note that, as of the time of writing, django-webtest is failing one of its unit
tests. It's not a failure that I think matters for our use, but I wanted to at
least remark on that to show readers of this OpenHatch but that I'm attentive to
that sort of thing. (-:
In terms of a process for actually getting this done, here is what I would
recommend:
* Add django-webtest (and its dependencies) to our dependencies
* Pick the 3 easiest tests of ours that use "tc.go", getting help from me or
anyone else as needed
And use that experience to answer the question, "Is django-webtest actually
worth using?" I think the answer will be yes, but by all means let's do a little
experiment before committing to it.
----------
messages: 4514
nosy: paulproteus
priority: wish
status: unread
title: Adjust our "twill tests" to either use Django's test client directly, or use django-webtest
__________________________________________
Roundup issue tracker <bugs at openhatch.org>
<https://openhatch.org/bugs/issue1028>
__________________________________________
More information about the Devel
mailing list