-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from lihuacai168/feat/crud-router
test: add more unittest, coverage up to 96%
- Loading branch information
Showing
10 changed files
with
135 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[run] | ||
omit = | ||
*/migrations/* | ||
*/tests/* | ||
apidemo/asgi.py | ||
apidemo/settings_dev.py | ||
apidemo/settings_docker.py | ||
apidemo/wsgi.py | ||
apidemo/wsgi_docker.py | ||
core/cache.py | ||
apidemo/celery_config.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Makefile | ||
|
||
# Defining the directory variables | ||
PROJECT_DIR = . | ||
COVERAGE_DIR = htmlcov | ||
|
||
# Run Django tests and collect coverage data | ||
test: | ||
@echo "Running tests with coverage..." | ||
@coverage run --source='$(PROJECT_DIR)' manage.py test | ||
|
||
# Generate an HTML coverage report | ||
html-report: | ||
@echo "Generating HTML coverage report..." | ||
@coverage html | ||
|
||
# Open the HTML coverage report in the browser | ||
open-report: | ||
@echo "Opening HTML coverage report..." | ||
@open $(COVERAGE_DIR)/index.html | ||
|
||
# Combine commands: run tests, generate and open HTML coverage report | ||
coverage: test html-report open-report | ||
|
||
# Marking targets as phony, they are not files | ||
.PHONY: test html-report open-report coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters