Skip to content

Commit

Permalink
updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
taka-rl committed Oct 21, 2024
1 parent 0934f00 commit 0ccd5c7
Showing 1 changed file with 76 additions and 11 deletions.
87 changes: 76 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,19 @@ This is a Flask web app example where I have been utilizing gained skills and kn
```
6. Run main.py
7. Use one of the accounts written as below to Login
- Super admin user:
email: [email protected]
password: admin
- user:
email:test@email.com
password: [email protected]
- Super admin user:
email: [email protected]
password: admin
- user:
email:test@email.com
password: [email protected]
8. Register a new user

9. Change user's role on ('/admin-dashboard') route.


9. Change user's role and delete registered users on ('/admin-dashboard') route.

## Design
### Directory structure
├── .github # GitHub actions
├── instance # database file
├── static # static files
│ ├── assets # img files
Expand Down Expand Up @@ -143,5 +142,71 @@ User:


## Testing
The section will be updated as it is under development.
pytest-flask is used for testing.
pytest-flask is used for testing. All the test files are stored in the tests folder.
Testing is connect to GitHub actions and tests are executed when commit or pull request happen.
GitHub actions is still under development because of some errors.

### How to run testing on your local environment
1. run this command in the terminal: ```python -m pytest```
If you would like to see more details on the tests: ```python -m pytest -v```

Here is the executed result of ```python -m pytest``` .
```
PS C:\folder path\flask_webapp> python -m pytest
========================================================================================================= test session starts =========================================================================================================
platform win32 -- Python 3.10.11, pytest-8.3.3, pluggy-1.5.0
rootdir: C:\folder path\flask_webapp
plugins: anyio-4.6.0, flask-1.3.0
collected 24 items
tests\test_about.py . [ 4%]
tests\test_admin.py .... [ 20%]
tests\test_auth.py ...... [ 45%]
tests\test_blog.py .... [ 62%]
tests\test_collection.py .... [ 79%]
tests\test_contact.py . [ 83%]
tests\test_useful_info.py . [100%]
''''
========================================================================================================== warnings summary ===========================================================================================================
=================================================================================================== 24 passed, 2 warnings in 6.34s ====================================================================================================
```


Here is the executed result of ```python -m pytest -v``` .
```
========================================================================================================= test session starts =========================================================================================================
platform win32 -- Python 3.10.11, pytest-8.3.3, pluggy-1.5.0 -- C:-----\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe
cachedir: .pytest_cache
rootdir: C:\folder path\flask_webapp
plugins: anyio-4.6.0, flask-1.3.0
collected 24 items
tests/test_about.py::test_about_access PASSED [ 4%]
tests/test_admin.py::test_check_super_admin_exist PASSED [ 8%]
tests/test_admin.py::test_admin_dashboard_access PASSED [ 12%]
tests/test_admin.py::test_change_user_role PASSED [ 16%]
tests/test_admin.py::test_delete_user PASSED [ 20%]
tests/test_auth.py::test_register_page PASSED [ 25%]
tests/test_auth.py::test_register_form PASSED [ 29%]
tests/test_auth.py::test_duplicated_email_register PASSED [ 33%]
tests/test_auth.py::test_login_page PASSED [ 37%]
tests/test_auth.py::test_login_form PASSED [ 41%]
tests/test_auth.py::test_logout PASSED [ 45%]
tests/test_blog.py::test_create_new_post PASSED [ 50%]
tests/test_blog.py::test_edit_post PASSED [ 54%]
tests/test_blog.py::test_delete_post PASSED [ 58%]
tests/test_blog.py::test_add_comment PASSED [ 62%]
tests/test_collection.py::test_access_collection_page PASSED [ 66%]
tests/test_collection.py::test_add_place PASSED [ 70%]
tests/test_collection.py::test_edit_place PASSED [ 75%]
tests/test_collection.py::test_delete_place PASSED [ 79%]
tests/test_contact.py::test_access_contact_page PASSED [ 83%]
tests/test_error.py::test_500_page PASSED [ 87%]
tests/test_error.py::test_404_page PASSED [ 91%]
tests/test_useful_info.py::test_access_useful_info_page PASSED [100%]
========================================================================================================== warnings summary ===========================================================================================================
=================================================================================================== 24 passed, 2 warnings in 6.46s ====================================================================================================
```

0 comments on commit 0ccd5c7

Please sign in to comment.