[Cubicweb] Simple forms unit-testing

Julien Jehannet julien.jehannet at logilab.fr
Fri Nov 26 14:28:04 CET 2010


Just to clarify,

> * Julien Jehannet <julien.jehannet at logilab.fr> [26-nov.-2010 11:47]:
> > * Adrien Di Mascio <adrien.dimascio at logilab.fr> [26-nov.-2010 09:35]:
> > Hi,
> > 
> > In one of my projects, I've implemented a somewhat simple API to test
> > the form rendering and submission. Let me tell immediately that this
> > is **pure python / off-browser** testing and therefore means that
> > this won't test any javascript / css / user interaction.
> > (...)
> > - form submission consists in three steps :
> >   1. using lxml's form_values() method to build a dict-like object
> >      based on actual input values
> >   2. building a CubicWeb's request object around that dict-like object
> >   3. using ctrl_publish() to process the request and go through the
> >      edit controller chain
> I'm +1 to commit your assert methods (in devtools/httptest.py).

I said devtools/httptest.py because I was considering mocking request
object but you can consider to have specific form test methods of course.

> Note that some helper methods already exist (web_*) for web testing.
This was just intended to inform whose didn't know their existence.

But I well understood that you want to test web forms here.
-- 
Julien JEHANNET                                          LOGILAB, Paris (France)
http://www.cubicweb.org                 CubicWeb, le cadriciel du web sémantique
http://www.logilab.org             Dépôt des logiciels libres conçus par Logilab
http://www.logilab.fr       Informatique scientifique & Gestion de connaissances



More information about the Cubicweb mailing list