*** This version of Confluence is for testing only and contains a copy of content from June 29th 2026. No changes will be preserved. ***
Test files are located in dev-backend/flask_docker/test
For now, to run this test:
- comment out 'application = create_app('DEV')' in app init.py
- cd to docker_code and run 'python3 -m unittest data/tests/db_helloworld_test.py'
Note: Please run the unit test in the docker container: under www/var (reference: Dev/Debug in Container)
Otherwise, you will need to install all dependencies in your local env.
samples_test.py functions | Doc |
|---|---|
get_user_auth | helper function to get auth for a mock user |
upload_sample_image | helper function to upload a sample image |
upload_sample_survey | helper function to upload sample survey (sample data) |
get_sample_survey | helper function to get survey data of a sample |
test_upload_sample | test if a user can upload a sample |
test_get_sample | test if a user can get a specific sample |
test_get_sample_count_total | test if a user can get the sample count |
test_get_samples | test if a user can get a sample list |
users_test.py functions | Doc |
|---|---|
| test_make_user | test if we can create a user successfully
|
authentication_test.py functions | Doc |
|---|---|
| test_authenticate_no_such_user | test authenticating non-existed user |
| test_authenticate_pwd_is_none | test authenticating a user who has not set password will send a password set email |
| test_authenticate_diff_pwd | test authenticating a user with the wrong password |
| test_authenticate | test authenticating a normal user |
| test_reset_password_invalid_email_address | test resetting password given an invalid email address |
| test_reset_password_update_pwd | test resetting password |
| test_reset_password_unauthorized | test resetting password for an unauthorized user |
| test_request_password_reset_invalid_email | test requesting password reset with an invalid email address |
| test_request_password_reset_no_user_data | test requesting password reset with non-existed user |
| test_request_password_reset | test requesting password reset |
| test_logout | test if a user can log out successfully |