Welcome | Get started | Dive | Contribute | Topics | Reference | Changes | More

lino.utils.pythontest

An extended TestCase for the plain python tests of a Lino project.

Classes

TestCase([methodName])

An extended atelier.test.TestCase to be run using setup.py in the root of a project that may contain several Django projects.

class lino.utils.pythontest.TestCase(methodName='runTest')

Bases: TestCase

An extended atelier.test.TestCase to be run using setup.py in the root of a project that may contain several Django projects.

This is different from the classes in lino.utils.djangotest, which are designed for unit tests to be run using djange-admin test within a particular Django project.

django_settings_module = None

The DJANGO_SETTINGS_MODULE to set for each subprocess launched by this test case.

run_django_manage_test(cwd=None, **kw)

Run python manage.py test command in the given directory.

run_django_admin_test_cd(cwd, **kw)

Run django-admin.py test in the given directory.

run_django_admin_command_cd(cwd, *cmdargs, **kw)

Run django-admin.py CMD in the given directory.

run_docs_doctests(filename)

Run a simple doctest for specified file after importing the docs conf.py (which causes the demo database to be activated).

This is used e.g. for testing pages like those below Testing pages.

http://docs.python.org/2/library/doctest.html#doctest.REPORT_ONLY_FIRST_FAILURE

These tests may fail for the simple reason that the demo database has not been initialized (in that case, run fab initdb).

do_test_demo_project(prjname)

Run test and demotest in a subprocess in the given demo project.