tests.py

This module contains tests which can be performed by a manager. Since the manager has access to all add/edit/remove user functionality these functions are all tested here.

Class definitions:

class apps.healthperson.management.tests.ManagementTest(methodName='runTest')[source]

Bases: core.unittest.baseunittest.BaseUnitTest

Provides the tests performed by a logged in manager

Check the default search page for different search criteria

Args:
  • url: the url to open
  • post_data: the data to post to that url
  • context_key: the key to look voor in the context after posting
  • full_name: the full_name of the user that should be found
Returns:
The response after posting the data
check_personalia()[source]

Checks the personalia view/edit pages of the manager

check_healthperson_pages(base_url, view_edit_pages)[source]

Check edit pages for different user types, try to post with default values that are retrieved with a ‘get’ request.

Args:
  • base_url: the base_url to build up the url to call
  • view_edit_pages: a list of parts of urls to use to get the view and post the edit page.
check_secretary_pages(secretary)[source]

Check the pages accessible by a manager for a secretary

Args:
  • secretary: the secretary to check the pages for
check_healthprofessional_pages(healthprofessional)[source]

Check the pages accessible by a manager for a healthprofessional

Args:
  • healthprofessional: the healthprofessional to check the pages for
check_patient_pages(patient)[source]

Check the pages accessible by a manager for a patient

Args:
  • patient: the patient to check the pages for
add_new_patient()[source]

Try adding a new patient

add_new_healthprofessional()[source]

Try adding a new healthprofessional

add_new_secretary()[source]

Try adding a new secretary

remove_healthprofessional(healthprofessional)[source]

Remove an healthprofessional

remove_patient(patient)[source]

Remove a patient

remove_secretary(secretary)[source]

Remove a secretary

test_management()[source]

Manager checks runner, performs all check definitions.