20131028 (Monday, 28 October 2013)

NameError at /api/courses/CoursesByLine

Displaying the detail of a course line caused an Internal Server Error “global name ‘format_time’ is not defined”

To fix the bug was a matter of two minutes. But then…

… but then wanted to quickly write a test case which reproduces this bug. This is tested by doing an http GET using the Django test client. I had a series of similar tests in Lino Welfare.

But these tests have always been rather difficult to maintain. I realized that I want a new kind of test case which does something similar to what until now was possible only using tested docs: run a test on the demo database without having Django create and populate a test database.

Here is the result of several hours of work: The new class lino.utils.test.DemoTestCase, welfare_demo_tests.py, (the converted test case in Lino Welfare), and faggio_demo_tests.py, (the case which has caused all this work).