Skip to content

Commit 9c4ffb8

Browse files
authored
Merge pull request #5 from betagouv/trecouvr/ci-tests
Run tests on CI
2 parents 4d82802 + bd949a3 commit 9c4ffb8

4 files changed

Lines changed: 13 additions & 2 deletions

File tree

.github/workflows/django.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,5 @@ jobs:
5151
run: poetry run ruff check docia
5252
- name: Run ruff format
5353
run: poetry run ruff format --check docia
54+
- name: Run tests
55+
run: poetry run pytest --no-migrations docia

docia/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
config.read_env(BASE_DIR / ".env")
2626

2727

28-
if "test" in sys.argv[0] or "test" in sys.argv[1]:
28+
if "pytest" in sys.argv[0] or ("manage.py" in sys.argv[0] and "test" in sys.argv[1]):
2929
print("LOAD TEST ENVIRONMENT VARIABLES! (TESTING=True)")
3030
config.read_env(BASE_DIR / "test.env")
3131

docia/urls.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
from lasuite.oidc_login.urls import urlpatterns as oidc_urls
2222
from magicauth.urls import urlpatterns as magicauth_urls
23-
from mozilla_django_oidc.urls import OIDCCallbackClass
2423

2524
from . import views
2625
from .auth import views as auth_views

test.env

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,13 @@ SMTP_HOST=
1717
SMTP_PORT=
1818
SMTP_USERNAME=
1919
SMTP_PASSWORD=
20+
21+
STORAGE_BACKEND=fs
22+
STORAGE_LOCAL_PATH=/tmp/data/
23+
AWS_S3_ENDPOINT_URL=https://s3.nohost
24+
AWS_S3_REGION_NAME=eu
25+
AWS_REQUEST_CHECKSUM_CALCULATION=WHEN_REQUIRED
26+
AWS_RESPONSE_CHECKSUM_VALIDATION=WHEN_REQUIRED
27+
STORAGE_S3_BUCKET_NAME=
28+
AWS_S3_ACCESS_KEY_ID=
29+
AWS_S3_SECRET_ACCESS_KEY=

0 commit comments

Comments
 (0)