From 5a27db22cbdf9df2a2a6b5963c461db1aa79ac9f Mon Sep 17 00:00:00 2001 From: Juliano Date: Thu, 11 Apr 2024 03:57:49 -0300 Subject: [PATCH] made simple test asn configured yaml file to github actions --- .github/workflows/test.yml | 27 +++++++++++++++++++++++++++ analytics/tests.py | 3 --- analytics/tests/__init__.py | 0 analytics/tests/tests.py | 21 +++++++++++++++++++++ db.sqlite3 | Bin 167936 -> 167936 bytes django_pandas/settings.py | 7 +++++++ 6 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/test.yml delete mode 100644 analytics/tests.py create mode 100644 analytics/tests/__init__.py create mode 100644 analytics/tests/tests.py diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..7f9aae7 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,27 @@ +name: Run Django Tests +on: + push: + branches: [master] +jobs: + test-django-app: + runs-on: ubuntu-latest + strategy: + fail-faat: false + matrix: + python-version: ['3.11'] + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - 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 + if [ -f requirements.txt ]: then pip install -r requirements.txt: fi + - name: + run: | + cd / + python manage.py test diff --git a/analytics/tests.py b/analytics/tests.py deleted file mode 100644 index 7ce503c..0000000 --- a/analytics/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. diff --git a/analytics/tests/__init__.py b/analytics/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/analytics/tests/tests.py b/analytics/tests/tests.py new file mode 100644 index 0000000..eb5c790 --- /dev/null +++ b/analytics/tests/tests.py @@ -0,0 +1,21 @@ +from django.test import TestCase +from analytics.models import Prova, Aluno +from django.db import models + +# Create your tests here. + +class TestApproval(TestCase): + def test_is_approved(self): + aluno = Aluno( + nome = "Mario Cirilo", + ) + aluno.save() + prova = Prova( + aluno = aluno, + nota = 6, + ) + if prova.nota >= 6: + prova.aprovado = True + prova.save() + + self.assertEqual(Prova.objects.get(id=aluno.id).aprovado, True) \ No newline at end of file diff --git a/db.sqlite3 b/db.sqlite3 index e1ea983fa5d51be96a9f53568bae4936d7d50a52..2ff8bd346682a91319a64154b484e2a43a146bc0 100644 GIT binary patch delta 222 zcmZozz}2vTYl1Xm*+dy<)-ndYvaXFO=kyq5CL8NJF>*JT>2EL7XY9McEX~h5m7U3u zjbEN$jGuR7<9R-5b{SR%Mn(=cZgy!1gNt1X!rfN delta 95 zcmV-l0HFVXpbCJX3XmHCaFHBC1#kc^X6mtI&MpBNlQS