Age | Commit message (Collapse) | Author |
|
|
|
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
|
|
* gn3/auth/authorisation/resources.py: dummy `user_resources` function
* tests/unit/auth/conftest.py: (incomplete): Add some fixtures for testing the
`user_resources` function
* tests/unit/auth/test_resources.py: test the `user_resources` function
|
|
* gn3/auth/authentication/checks.py: new `authenticated_p` decorator to apply
on any function that requires the user to be authenticated before it runs.
* gn3/auth/authorisation/checks.py: use a `auth.authentication.users.User`
object rather than a UUID object in the global `g`.
* gn3/auth/authorisation/groups.py: Implement the `authenticated_user_group`
function to get the group(s) in which the currently authenticated user
belongs.
* gn3/auth/authorisation/resources.py: Implement the `create_resource`
function correctly.
* tests/unit/auth/conftest.py: extract the User objects into a global variable
for reusability with the tests.
* tests/unit/auth/test_resources.py: Use global user objects from conftest in
the tests. Set a User object (rather than UUID) in the global `g` variable.
|
|
* gn3/auth/authorisation/groups.py: Add `GroupRole` type. Fix typing
annotations. Fix bugs.
* tests/unit/auth/conftest.py: Fix bugs.
* tests/unit/auth/test_groups.py: Fix test to run.
|
|
* tests/unit/auth/conftest.py: Add fixtures to help with testing
* tests/unit/auth/test_groups.py: Add incomplete and failing test
|
|
|
|
* tests/unit/auth/conftest.py: use the functions in `gn3.auth.db` to acquire
the database connection and cursor since they handle some of the basic
issues like rollback and commit, meaning we do not have to explicitly handle
said issues in the fixtures.
|
|
|
|
* gn3/auth/authorisation/__init__.py: Add `authorised_p` decorator to be used
for all function requiring authorisation.
* gn3/auth/authorisation/groups.py: Add `create_group` function stub
* tests/unit/auth/conftest.py: Add fixture for test users
* tests/unit/auth/test_groups.py: Add tests for `create_group`
|
|
|
|
* tests/unit/auth/conftest.py: add fixtures specific to auth
* tests/unit/auth/test_migration_create_users_table.py: import from new
fixtures module
* tests/unit/conftest.py: remove auth-specific fixtures from *ALL* unit tests
fixture module.
|