Version 1 (modified by somayjain, 11 years ago) ( diff )


Roles Tests


Role tests are used to check the permissions of user roles.

Running The Tests

Make sure that the database is prepopulated. If not, then run -

cd web2py/applications/eden
rm databases/*
cd ../..
python -S eden -M -R applications/eden/static/scripts/tools/

To start the tests, run -

python -S eden -M -R applications/eden/modules/tests/ -A --suite roles

Information About the Test Suite


The tests are located in modules/tests/roles/

The template specific files are located in modules/tests/roles/<template_name>


  • The file modules/tests/roles/ tests permissions against role matrix file.
  • The data for the roles tests is created by modules/tests/roles/
    • It depends on the following for creating the data -
      • org_organisation.xml - A generic file for all templates. It is used for importing the organisation.
      • org_organisation_branch.xml - A generic file for all templates. It is used for importing the organisation branches, if the template uses branches.
      • <template_name>/data.xml - A file template for the data which the user's roles will be tested against.
      • <template_name>/users_template.csv - A file template for the users and roles which will be tested.
      • <template_name>/test_users.csv - An optional file which is used to create users - handy for debugging.
  • The user permissions are defined in <template_name>/Org-A_permission_matrix.csv. The permissions declared in this file are tested upon.
Note: See TracWiki for help on using the wiki.