From 17ee356975fa5a1dccca2017061823aaead8d5d7 Mon Sep 17 00:00:00 2001 From: taptorestart Date: Sat, 22 Feb 2025 09:54:06 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Upgrade=20dependencies?= =?UTF-8?q?=20to=20latest=20versions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/requirements-test.txt | 8 ++++---- backend/requirements.txt | 24 ++++++++++++------------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/backend/requirements-test.txt b/backend/requirements-test.txt index 14808f7..8a80d46 100644 --- a/backend/requirements-test.txt +++ b/backend/requirements-test.txt @@ -1,4 +1,4 @@ -pytest==7.3.1 -pytest-django==4.5.2 -factory-boy==3.2.1 -pytest-bdd==7.0.1 +pytest==8.3.4 +pytest-django==4.10.0 +factory-boy==3.3.3 +pytest-bdd==8.1.0 diff --git a/backend/requirements.txt b/backend/requirements.txt index e455e0a..a451376 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -1,20 +1,20 @@ # Django -Django==4.2.5 -djangorestframework==3.14.0 -drf-nested-routers==0.93.4 -drf-spectacular==0.26.2 -psycopg2-binary==2.9.9 -django-unfold==0.16.0 # Django Admin Theme +Django==4.2.19 +djangorestframework==3.15.2 +drf-nested-routers==0.94.1 +drf-spectacular==0.28.0 +psycopg2-binary==2.9.10 +django-unfold==0.49.1 # Django Admin Theme # celery -celery==5.2.7 -redis==4.5.4 +celery==5.4.0 +redis==5.2.1 # excel -pandas==2.0.1 -openpyxl==3.1.2 +pandas==2.2.3 +openpyxl==3.1.5 -python-dotenv==1.0.0 +python-dotenv==1.0.1 # Formatter -black==23.3.0 +black==25.1.0 From 6e1d7abbde23ab89f8b0f1c8a55c74b219752432 Mon Sep 17 00:00:00 2001 From: taptorestart Date: Sat, 22 Feb 2025 10:22:49 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=E2=9C=85=20Fix=20BDD=20test=20failing=20du?= =?UTF-8?q?e=20to=20step=20definition=20changes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/tests/apis/v1/forms/form_create.feature | 4 ++-- backend/tests/apis/v1/forms/form_delete.feature | 2 +- backend/tests/apis/v1/forms/form_list.feature | 2 +- .../apis/v1/forms/form_partial_update.feature | 6 +++--- backend/tests/conftest.py | 15 ++++++--------- 5 files changed, 13 insertions(+), 16 deletions(-) diff --git a/backend/tests/apis/v1/forms/form_create.feature b/backend/tests/apis/v1/forms/form_create.feature index aff06e6..65ff5c9 100644 --- a/backend/tests/apis/v1/forms/form_create.feature +++ b/backend/tests/apis/v1/forms/form_create.feature @@ -3,7 +3,7 @@ Feature: Form Create Test Scenario Outline: Form Create Permission Test Given I am a user. And I am logged in. - And The following data will be sent. + And The following data will be sent: """ { "slug": "test", @@ -23,7 +23,7 @@ Feature: Form Create Test Scenario: Form Create Test Given I am a staff user. And I am logged in. - And The following data will be sent. + And The following data will be sent: """ { "slug": "test", diff --git a/backend/tests/apis/v1/forms/form_delete.feature b/backend/tests/apis/v1/forms/form_delete.feature index 85eec77..a363095 100644 --- a/backend/tests/apis/v1/forms/form_delete.feature +++ b/backend/tests/apis/v1/forms/form_delete.feature @@ -1,7 +1,7 @@ @django_db Feature: Form Delete Test Background: - Given I will save the following data using Form model. + Given I will save the following data using Form model: """ { "id": 101, diff --git a/backend/tests/apis/v1/forms/form_list.feature b/backend/tests/apis/v1/forms/form_list.feature index 37a5c86..894415d 100644 --- a/backend/tests/apis/v1/forms/form_list.feature +++ b/backend/tests/apis/v1/forms/form_list.feature @@ -1,7 +1,7 @@ @django_db Feature: Form List Test Background: - Given I will save the following data using Form model. + Given I will save the following data using Form model: """ { "id": 101, diff --git a/backend/tests/apis/v1/forms/form_partial_update.feature b/backend/tests/apis/v1/forms/form_partial_update.feature index 86b87fe..3ef1196 100644 --- a/backend/tests/apis/v1/forms/form_partial_update.feature +++ b/backend/tests/apis/v1/forms/form_partial_update.feature @@ -1,7 +1,7 @@ @django_db Feature: Form Partial Update Test Background: - Given I will save the following data using Form model. + Given I will save the following data using Form model: """ { "id": 101, @@ -15,7 +15,7 @@ Feature: Form Partial Update Test Scenario Outline: Form Partial Update Permission Test Given I am a user. And I am logged in. - And The following data will be sent. + And The following data will be sent: """ { "title": "test1" @@ -33,7 +33,7 @@ Feature: Form Partial Update Test Scenario: Form Partial Update Test Given I am a staff user. And I am logged in. - And The following data will be sent. + And The following data will be sent: """ { "title": "test2" diff --git a/backend/tests/conftest.py b/backend/tests/conftest.py index 107ed6b..d83777d 100644 --- a/backend/tests/conftest.py +++ b/backend/tests/conftest.py @@ -71,12 +71,9 @@ def i_am_making_a_method_request_to_path(client, method, path): return response -@given( - parsers.parse("The following data will be sent.\n{data}"), - target_fixture="data", -) -def the_following_data_will_be_sent(data): - return json.loads(data) +@given(parsers.parse("The following data will be sent:"), target_fixture="data") +def the_following_data_will_be_sent(docstring): + return json.loads(docstring) @when( @@ -99,13 +96,13 @@ def i_am_sending_a_method_request_to_path_with_data(client, method, path, data): @given( - parsers.parse("I will save the following data using {model_class_name} model.\n{data}"), + parsers.cfparse("I will save the following data using {model_class_name} model:"), ) -def i_will_save_the_following_data_using_factory_class_name_from_module(model_class_name: str, data: str): +def i_will_save_the_following_data_using_factory_class_name_from_module(model_class_name: str, docstring): module = importlib.import_module("backend.tests.factories") factory_class_name = f"{model_class_name}Factory" factory_class = getattr(module, factory_class_name) - factory_class(**json.loads(data)) + factory_class(**json.loads(docstring)) return None From 44cb0da7e1184dc43d99d316abeedc7ceb73a221 Mon Sep 17 00:00:00 2001 From: taptorestart Date: Sat, 22 Feb 2025 10:26:58 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=94=A7=20Rename=20ci=20workflow=20fro?= =?UTF-8?q?m=20"Run=20tests"=20to=20"CI"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 06fe1c1..51d282e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,4 +1,4 @@ -name: Run tests +name: CI on: pull_request: