Skip to content

Commit

Permalink
add test generation and github action execution
Browse files Browse the repository at this point in the history
  • Loading branch information
lilioid committed Feb 12, 2024
1 parent 27fa18c commit 9946fa7
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,5 @@ jobs:
run: |
chmod +x ./src/manage.py
pipenv run ./src/manage.py --help
- name: pytest
run: pytest
2 changes: 2 additions & 0 deletions {{ cookiecutter.project_slug }}/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ opentelemetry-exporter-prometheus = "*" # translation of telemet
ipython = "*"
black = "*"
isort = "*"
pytest = "*"
pytest-django = "*"

[requires]
python_version = "3"
8 changes: 8 additions & 0 deletions {{ cookiecutter.project_slug }}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,11 @@ line-length = 110

[tool.isort]
profile = "black"

[tool.pytest.ini_options]
pythonpath = "src"
testpaths = "src/{{ cookiecutter.project_slug }}/tests"
log_cli = true
log_cli_level = "info"
django_find_project = false
DJANGO_SETTINGS_MODULE = "{{ cookiecutter.project_slug }}.settings"
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from django.shortcuts import resolve_url


def test_django_loads():
from django.conf import settings
assert len(settings.INSTALLED_APPS) > 0


def test_openapi_schema_loads(client):
response = client.get(resolve_url("openapi_schema"))
assert response.status == 200

0 comments on commit 9946fa7

Please sign in to comment.