AKModel.tests module
- class AKModel.tests.BasicViewTests[source]
Bases:
object
Parent class for “standard” tests of views
Provided with a list of views and arguments (if necessary), this will test that views - render correctly without errors - are only reachable with the correct rights (neither too freely nor too restricted)
To do this, the test creates sample users, fixtures are loaded automatically by the django test framework. It also provides helper functions, e.g., to check for correct messages to the user or more simply generate the URLs to test
In this class, methods from
TestCase
will be called at multiple places event though TestCase is not a parent of this class but has to be included as parent in concrete implementations of this class seperately. It however still makes sense to treat this class as some kind of mixin and not implement it as a child of TestCase, since the test framework does not understand the concept of abstract test definitions and would handle this class as real test case otherwise, distorting the test results.- test_views_for_200()[source]
Test the list of public views (as specified in “VIEWS”) for error-free rendering