You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
9. Change user's role on ('/admin-dashboard') route.
53
-
54
-
52
+
9. Change user's role and delete registered users on ('/admin-dashboard') route.
55
53
56
54
## Design
57
55
### Directory structure
56
+
├── .github # GitHub actions
58
57
├── instance # database file
59
58
├── static # static files
60
59
│ ├── assets # img files
@@ -64,8 +63,15 @@ This is a Flask web app example where I have been utilizing gained skills and kn
64
63
├── templates # route html files
65
64
├── tests # tests
66
65
│ ├── conftest.py # set up for testing
67
-
│ ├── test_auth.py # test for auth routes
68
-
│ └── other routes # will be committed later
66
+
│ ├── parameters.py # parameters for test
67
+
│ ├── test_about.py # test for about route
68
+
│ ├── test_admin.py # test for admin route
69
+
│ ├── test_auth.py # test for auth route
70
+
│ ├── test_blog.py # test for blog route
71
+
│ ├── test_collection.py # test for collection route
72
+
│ ├── test_contact.py # test for contact route
73
+
│ ├── test_error.py # test for error route
74
+
│ └── test_useful_info.py # test for useful_info route
69
75
├── flask_app
70
76
│ ├── __init__.py # Initialize Flask app and extensions
71
77
│ ├── forms.py # Forms
@@ -126,6 +132,7 @@ User:
126
132
## Current development
127
133
- Testing
128
134
- Documentation
135
+
- Add github actions, which is python-app.yml to execute pytest
129
136
130
137
## Future development:
131
138
- Improve the web page design
@@ -135,5 +142,71 @@ User:
135
142
136
143
137
144
## Testing
138
-
The section will be updated as it is under development.
139
-
pytest-flask is used for testing.
145
+
pytest-flask is used for testing. All the test files are stored in the tests folder.
146
+
Testing is connect to GitHub actions and tests are executed when commit or pull request happen.
147
+
GitHub actions is still under development because of some errors.
148
+
149
+
### How to run testing on your local environment
150
+
1. run this command in the terminal: ```python -m pytest```
151
+
If you would like to see more details on the tests: ```python -m pytest -v```
152
+
153
+
Here is the executed result of ```python -m pytest``` .
154
+
```
155
+
PS C:\folder path\flask_webapp> python -m pytest
156
+
========================================================================================================= test session starts =========================================================================================================
=================================================================================================== 24 passed, 2 warnings in 6.34s ====================================================================================================
173
+
```
174
+
175
+
176
+
Here is the executed result of ```python -m pytest -v``` .
177
+
```
178
+
========================================================================================================= test session starts =========================================================================================================
0 commit comments