12 Oct 2008 henrique   » (Journeyer)

Testing your django app

Today, I found this nice blog post about testing on django:

http://ericholscher.com/blog/2008/jul/26/testmaker-002-even- easier-automated-testing-django/

It is interesting to see the way the test process is realized, it makes me remember a similar problem we had on the stoqdrivers (part of the Stoq project).

In that project we needed to (automatically) test our code against a couple of fiscal printers... teorically we would need to have connected all the printers at the same computer to run the test suite, and even this being possible, the tests would run very slowly and a lot of paper would be needed (apart the risk of putting the printer in a inconsistent state, what would make the printer unusable for a day at least :)

The solution was to log all the commands sent to the printer and the output returned. Once this log was saved, we could use it to feed the code, through a virtual printer (or actually through several virtual printers, created on demand based on the list of printers supported).

I think this way of testing has a defined name, but it still unknown for me... However, it is nice to see this "pattern" being validated in other areas like web and desktop applications development.

By the way, you can check the stoqdrivers test implementation at the: project's source web browser.

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!