Ignore:
Timestamp:
13 May 2015, 13:01:01 (9 years ago)
Author:
Henrik Bettermann
Message:

Integrate first Python test into handbook.

Location:
main/waeup.kofa/trunk/docs/source/userdocs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/docs/source/userdocs/testing.rst

    r12929 r12930  
    2727manually.
    2828
    29 What we test: "unit" and "functional" Tests
     29What we test: "Unit" and "Functional" Tests
    3030-------------------------------------------
    3131
     
    4747
    4848There are also two different ways to integrate tests, either
    49 functional or unit, into a Python package: *doc tests* (or doctests)
     49functional or unit, into a Python package: *Doctest tests* (or doctests)
    5050and *Python tests*. Python test modules are a collection of
    5151isolatable Python test cases. A test case combines a collection of
    52 unit test methods which are being executed by the testrunner one
     52test methods which are being executed by the testrunner one
    5353after the other. Python test modules are automatically identified by
    5454means of their filenames which start with ``test_``. In contrast,
     
    8686
    8787
    88 Doctests
    89 ========
     88Doctest Tests
     89=============
    9090
    9191Browsing
     
    159159============
    160160
     161There are hundreds of Python test cases in Kofa with many test
     162methods each. Here we present only a few of them. The test methods
     163are easy to read. In most cases they are functional and certain
     164methods and properties of a test browser are called. Most important
     165are `browser.open()` (opens a web page), `browser.getControl()`
     166(gets a control button), `browser.getLink()` (gets a link) and
     167`browser.contents` (is the HTML content of the opened page).
     168
     169.. _test_suspended_officer:
     170
     171Suspended Officer Account Test
     172------------------------------
     173
     174The first test can be found in
     175`waeup.kofa.browser.tests.test_browser.SupplementaryBrowserTests`:
     176
    161177.. literalinclude:: ../../../src/waeup/kofa/browser/tests/test_browser.py
    162178   :pyobject: test_suspended_officer
     179
     180The test makes sure that a suspended officers can't login but see a
     181proper warning message when trying to login. Furthermore, suspended
     182officer accounts are clearly marked and a warning message shows up
     183if a manager accesses an suspended account, see :ref:`Officers
     184<officers>`.
  • main/waeup.kofa/trunk/docs/source/userdocs/users.rst

    r12926 r12930  
    4444serves as user title.
    4545
     46.. _officers:
    4647
    4748Officers
     
    5152
    5253   :ref:`Officers Doctests <userscontainer_txt>`
     54
     55   :ref:`Officers Python Test <test_suspended_officer>`
    5356
    5457Officers are users with a dedicated user account object stored in the
Note: See TracChangeset for help on using the changeset viewer.