organisations.tests.integration package#

Submodules#

organisations.tests.integration.01_high_level_admin module#

class organisations.tests.integration.01_high_level_admin.OrgHighLevelAdmin(manager: CobaltTestManagerIntegration)[source]#

Bases: object

Tests for higher level admin functions such as creating clubs and setting up RBAC.

These actions generally require state or national body level admin rights.

Club admins can also change the RBAC settings for their club which is also tested here.

Alan Admin has the role “orgs.admin.edit” and can add clubs for any state. Betty Bunting has “orgs.state.3” - NSW. Colin Corgy has “orgs.state.5” - QLD.

a1_admin_add_club()[source]#
a2_admin_change_rbac_configuration()[source]#

Changing RBAC configuration for a club

organisations.tests.integration.02_club_level_admin module#

class organisations.tests.integration.02_club_level_admin.ClubLevelAdmin(manager: CobaltTestManagerIntegration)[source]#

Bases: object

Tests for club level admin. These are the changes that club admins will do regularly. State and system admins should also be able to do this.

NSW = 3#
QLD = 5#
a1_access_club_menu()[source]#

Check who can access the club menu

a2_rbac_basic_user_admin()[source]#

Test user admin for Basic RBAC

a3_rbac_advanced_user_admin()[source]#

user admin tests for advanced RBAC

organisations.tests.integration.03_club_settings module#

class organisations.tests.integration.03_club_settings.ClubSettings(manager: CobaltTestManagerIntegration)[source]#

Bases: object

Tests for club menu settings

a1_club_details()[source]#

Change Club Details and see what happens

a2_membership_types()[source]#

Test club membership types

organisations.tests.integration.04_club_members module#

class organisations.tests.integration.04_club_members.ClubMembers(manager: CobaltTestManagerIntegration)[source]#

Bases: object

Tests for club menu members. Some of these tests connect to the MPC so data may change over time.

a1_import_members()[source]#

Import Members to this club

organisations.tests.integration.05_club_comms module#

class organisations.tests.integration.05_club_comms.ClubComms(manager: CobaltTestManagerIntegration)[source]#

Bases: object

Tests for club communications

a1_comms_tags()[source]#

Do things with tags

organisations.tests.integration.06_congress_setup module#

class organisations.tests.integration.06_congress_setup.ClubCongress(manager: CobaltTestManagerIntegration)[source]#

Bases: object

Tests for club congresses

a1_comms_tags()[source]#

Do things with tags

organisations.tests.integration.common_functions module#

Common functions for organisations.

organisations.tests.integration.common_functions.access_club_menu(manager: CobaltTestManagerIntegration, user: User, club_id: int, expected_club_name: str, test_name: str, test_description: str, reverse_result=False)[source]#

Common function to check access to the club menu for different users

The club menu uses a lot of HTMX so we access this through Selenium.

Initial Selenium State: Any Final Selenium State: On front page of Club Menu for provided club name as provided user

Parameters:
  • manager – test_manager.Manager object for interacting with system

  • user – User object

  • club_id – Django id of club, not org_id

  • expected_club_name – name we expect to find in the H1

  • test_description – long description of test

  • test_name – name of test

  • reverse_result – for tests that should fail

organisations.tests.integration.common_functions.access_finance_for_club(manager: CobaltTestManagerIntegration, club: Organisation, user: User, test_name: str, test_description: str, reverse_result=False)[source]#

Common function to move to the Access tab

Initial Selenium State: Doesn’t matter Final Selenium State: On Organisation Statement logged in as User

Parameters:
  • manager – test_manager.Manager object for interacting with system

  • club – club to check for

  • user – User to use for test

  • test_description – long description of test

  • test_name – name of test

  • reverse_result – for tests that should fail

organisations.tests.integration.common_functions.add_club(manager: CobaltTestManagerIntegration, user: User = None, view_data=None, reverse_result=False)[source]#

Common function to try to add a club

Parameters:
  • manager – test_manager.Manager object for interacting with system

  • user – User object

  • view_data – dic thing for the view

  • reverse_result – swap True for False - we want this to fail

organisations.tests.integration.common_functions.change_rbac_status_as_user(manager: CobaltTestManagerIntegration, user: User, club_org_id: int, new_status: str, test_name: str, test_description: str, reverse_result: bool)[source]#

Common function to change the rbac state of a club and check the outcome. Sometimes we expect this to fail.

Parameters:
  • manager – test_manager.Manager object for interacting with system

  • user – User object

  • club_org_id – org id of club

  • new_status – status to change to

  • test_description – long description of test

  • test_name – name of test

  • reverse_result – for tests that should fail

organisations.tests.integration.common_functions.club_menu_go_to_tab(manager: CobaltTestManagerIntegration, tab: str, title_id: str, test_name: str, test_description: str)[source]#

Common function to move to the Access tab

Initial Selenium State: On any tab of Club Menu Final Selenium State: On specified tab of Club Menu

Parameters:
  • manager – test_manager.Manager object for interacting with system

  • tab – the tab we want to go to

  • title_id – id of the title, should appear if we successfully click on tab

  • test_description – long description of test

  • test_name – name of test

organisations.tests.integration.common_functions.club_menu_items(manager: CobaltTestManagerIntegration, expected_tabs: list, test_name: str, test_description: str)[source]#

Common function to check which tabs a user has access to

Initial Selenium State: On front page of Club Menu Final Selenium State: On front page of Club Menu

Parameters:
  • manager – test_manager.Manager object for interacting with system

  • expected_tabs – the tabs we expect to find

  • test_description – long description of test

  • test_name – name of test

organisations.tests.integration.common_functions.confirm_club_rbac_status(manager: CobaltTestManagerIntegration, club_org_id: int, expected_status: str, test_name: str, test_description: str, reverse_result=False)[source]#

Common function to test the rbac status of a club

Parameters:
  • manager – test_manager.Manager object for interacting with system

  • club_org_id – org id of club

  • expected_status – what the status should be

  • test_description – long description of test

  • test_name – name of test

  • reverse_result – if failure is a good outcome

organisations.tests.integration.common_functions.login_and_go_to_club_menu(manager: CobaltTestManagerIntegration, org_id: int, user: User, test_description: str, test_name: str, reverse_result: bool)[source]#

Login and got to the club menu

Initial Selenium State: Doesn’t matter Final Selenium State: On Club Menu logged in as User (if allowed)

Parameters:
  • manager – test_manager.Manager object for interacting with system

  • org_id – club to check for

  • user – User to use for test

  • test_description – long description of test

  • test_name – name of test

  • reverse_result – for tests that should fail

organisations.tests.integration.common_functions.set_rbac_status_as_user(manager: CobaltTestManagerIntegration, user: User, club_org_id: int, new_status: str, test_name: str, test_description: str, reverse_result: bool)[source]#

Common function to change the rbac state of a club and check the outcome. Sometimes we expect this to fail.

Parameters:
  • manager – test_manager.Manager object for interacting with system

  • user – User object

  • club_org_id – org id of club

  • new_status – status to change to

  • test_description – long description of test

  • test_name – name of test

  • reverse_result – for tests that should fail

Module contents#