| 1 | = Roles Tests = |
| 2 | |
| 3 | == Introduction == |
| 4 | |
| 5 | Role tests are used to check the permissions of user roles. |
| 6 | |
| 7 | == Running The Tests == |
| 8 | |
| 9 | Make sure that the database is prepopulated. If not, then run - |
| 10 | {{{ |
| 11 | cd web2py/applications/eden |
| 12 | rm databases/* |
| 13 | cd ../.. |
| 14 | python web2py.py -S eden -M -R applications/eden/static/scripts/tools/noop.py |
| 15 | }}} |
| 16 | |
| 17 | To start the tests, run - |
| 18 | {{{ |
| 19 | python web2py.py -S eden -M -R applications/eden/modules/tests/suite.py -A --suite roles |
| 20 | }}} |
| 21 | |
| 22 | == Information About the Test Suite == |
| 23 | |
| 24 | === Location === |
| 25 | |
| 26 | The tests are located in {{{modules/tests/roles/}}} |
| 27 | |
| 28 | The template specific files are located in {{{modules/tests/roles/<template_name>}}} |
| 29 | |
| 30 | === Files === |
| 31 | |
| 32 | * The file {{{modules/tests/roles/test_roles.py}}} tests permissions against role matrix file. |
| 33 | * The data for the roles tests is created by {{{modules/tests/roles/create_role_test_data.py}}} |
| 34 | * It depends on the following for creating the data - |
| 35 | * {{{org_organisation.xml}}} - A generic file for all templates. It is used for importing the organisation. |
| 36 | * {{{org_organisation_branch.xml}}} - A generic file for all templates. It is used for importing the organisation branches, if the template uses branches. |
| 37 | * {{{<template_name>/data.xml}}} - A file template for the data which the user's roles will be tested against. |
| 38 | * {{{<template_name>/users_template.csv}}} - A file template for the users and roles which will be tested. |
| 39 | * {{{<template_name>/test_users.csv}}} - An optional file which is used to create users - handy for debugging. |
| 40 | * The user permissions are defined in {{{<template_name>/Org-A_permission_matrix.csv}}}. The permissions declared in this file are tested upon. |
| 41 | |