aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/auth/fixtures/user_fixtures.py
AgeCommit message (Expand)Author
2023-03-08auth: users: Use the same basic functions for password hashing...To avoid repeating the same thing in multiple places, leading to errors and breakages, reuse the same basic functions for password hashing. Frederick Muriuki Muriithi
2023-01-11auth: assign default role. separate group creation from group admin...A newly registered user will have the ability to create a group. Once a user is a member of a group, either by creating a new group, or being added to a group, they should not be able to create any more groups, i.e. they lose the 'create-group' (and/or equivalent) privileges. This means that the group-administration privileges should be separated from the group-creation privilege. * gn3/auth/authorisation/roles.py: assign default roles to user on registration * gn3/auth/authorisation/views.py: assign default roles to user on registration * migrations/auth/20230111_01_Wd6IZ-remove-create-group-privilege-from-group-leader.py: separate group-creation role from group-administration role. * tests/unit/auth/fixtures/user_fixtures.py: Add group-creation role to test user * tests/unit/auth/test_roles.py: Add the group-creation role explicitly in the expected results for the test Frederick Muriuki Muriithi
2023-01-03auth: rename fixtures: test_* -> fxtr_*...Since test functions are defined starting with "test_", rename the fixture to more clearly indicate it is a fixture (fxtr_*), an not a test in itself. Frederick Muriuki Muriithi
2022-12-22auth: implement OAuth2 flow....Add code to implement the OAuth2 flow. * Add test fixtures for setting up users and OAuth2 clients * Add tests for token generation with the "Password Grant" flow * Fix some issues with test due to changes in the database connection's row_factory oauth2_auth_flowFrederick Muriuki Muriithi
2022-12-12tests: Reorganise fixtures...Split the fixtures into separate modules for easier management * tests/unit/auth/conftest.py: Import all from the `fixtures` package. Delete all fixtures from the file * tests/unit/auth/fixtures/__init__.py: new `fixtures` package * tests/unit/auth/fixtures/group_fixtures.py: new groups fixtures module * tests/unit/auth/fixtures/migration_fixtures.py: new migrations fixtures module * tests/unit/auth/fixtures/resource_fixtures.py: new resources fixtures module * tests/unit/auth/fixtures/role_fixtures.py: new roles fixtures module * tests/unit/auth/fixtures/user_fixtures.py: new users fixtures module Frederick Muriuki Muriithi