Changes between Version 1 and Version 2 of DeveloperGuidelines/Testing/Roles


Ignore:
Timestamp:
08/21/13 23:20:06 (12 years ago)
Author:
Michael Howden
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelines/Testing/Roles

    v1 v2  
    2020}}}
    2121
    22 == Information About the Test Suite ==
     22== Writing Role Tests for a Template ==
    2323
    24 === Location ===
     24To write role tests for a template, you will need to create a folder for that template in the role test folder: {{{modules/tests/roles/<template_name>}}}. In this folder you'll have to create the following files.
    2525
     26=== organisations ===
     27{{{<template_name>/organisations.xml}}}[[BR]]
     28This file will specify which organisations & branches data & users are created for.
     29
     30
     31=== data ===
     32{{{<template_name>/data.xml}}}[[BR]]
     33This file will define the data that will be created for the user's roles will be tested against. See existing examples and [wiki:S3XML#XMLFormat] for how to format this file. This file will include the string {{{%(org)s}}} which will be replaced with the name of the organisation/branch.
     34
     35=== users template ===
     36{{{<template_name>/users_template.csv}}}[[BR]]
     37A file template for the users and roles which will be tested. See existing examples for how to format this file. This file will include the string {{{%(org)s}}} which will be replaced with the name of the organisation/branch. To assign a role for an organisation, using this syntax: {{{<role_name>/org_organisation.name=%(org)s}}}.
     38
     39=== Test Users (optional) ===
     40{{{<template_name>/test_users.csv}}}[[BR]]
     41An optional file which is used to create users - handy for debugging.
     42
     43=== Permission Matrix ===
     44{{{<template_name>/Org-A_permission_matrix.csv}}}[[BR]]
     45The permissions declared in this file are tested upon. Currently permissions are only tested for users from Org-A, but you can test their access to data from other Organisations.
     46
     47== Role Test Documentation  ==
    2648The 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 
     49Files:
    3250* The file {{{modules/tests/roles/test_roles.py}}} tests permissions against role matrix file.
    3351* 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.
    4152
     53