Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run tests
name: CI

on:
pull_request:
Expand Down
8 changes: 4 additions & 4 deletions backend/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -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
24 changes: 12 additions & 12 deletions backend/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions backend/tests/apis/v1/forms/form_create.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Feature: Form Create Test
Scenario Outline: Form Create Permission Test
Given I am a <user_type> user.
And I am logged in.
And The following data will be sent.
And The following data will be sent:
"""
{
"slug": "test",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion backend/tests/apis/v1/forms/form_delete.feature
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
2 changes: 1 addition & 1 deletion backend/tests/apis/v1/forms/form_list.feature
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
6 changes: 3 additions & 3 deletions backend/tests/apis/v1/forms/form_partial_update.feature
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -15,7 +15,7 @@ Feature: Form Partial Update Test
Scenario Outline: Form Partial Update Permission Test
Given I am a <user_type> user.
And I am logged in.
And The following data will be sent.
And The following data will be sent:
"""
{
"title": "test1"
Expand All @@ -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"
Expand Down
15 changes: 6 additions & 9 deletions backend/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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


Expand Down
Loading