Skip to content

Commit

Permalink
re-add cicd test
Browse files Browse the repository at this point in the history
  • Loading branch information
maelys-buhler committed Apr 19, 2024
1 parent 6be747a commit 9ec8801
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
36 changes: 36 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Django CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.11]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
cd api
pip install -r requirements.txt
- name: Copy .env
run: |
cd api
cp .env.cicd .env
- name: Run Tests
run: |
cd api
python manage.py test
3 changes: 2 additions & 1 deletion api/masteriqapp/tests/test_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ class RouteTestCases(TestCase):
def test_route(self):
c = Client()

response = c.post("/api/user/signup/", {"username":"test", "password":"test"})
response = c.post("/api/user/register/", {"username":"test", "password":"test"})
print(response.status_code)
assert response.status_code == 201

response = c.get("/api/category/1/image/")
Expand Down

0 comments on commit 9ec8801

Please sign in to comment.