diff options
author | Matthew Lemon <y@yulqen.org> | 2024-09-10 11:13:15 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-09-10 11:13:15 +0100 |
commit | 86c02670efcb1a219acff44fd8b5b723ac30bfa0 (patch) | |
tree | 548a387879fb7deb22ec2fffb7ac35ea3b0ee3ac | |
parent | e3b47f5218aa9155e933c58465aebc071485df40 (diff) |
Removes marks on fixtures to handle deprecation warning
-rw-r--r-- | engagements/tests/test_forms.py | 1 | ||||
-rw-r--r-- | engagements/tests/test_models.py | 1 | ||||
-rw-r--r-- | engagements/tests/test_views.py | 7 | ||||
-rw-r--r-- | instruments/tests/test_models.py | 4 |
4 files changed, 8 insertions, 5 deletions
diff --git a/engagements/tests/test_forms.py b/engagements/tests/test_forms.py index b9807dd..24077e9 100644 --- a/engagements/tests/test_forms.py +++ b/engagements/tests/test_forms.py @@ -6,6 +6,7 @@ from engagements.models import EngagementType pytestmark = pytest.mark.django_db + def test_basic_validation(engagement, user): form = EngagementEffortCreateForm( data={ diff --git a/engagements/tests/test_models.py b/engagements/tests/test_models.py index 73738db..9b15307 100644 --- a/engagements/tests/test_models.py +++ b/engagements/tests/test_models.py @@ -4,7 +4,6 @@ from engagements.utils import populate_database @pytest.fixture -@pytest.mark.django_db def data(): return populate_database() diff --git a/engagements/tests/test_views.py b/engagements/tests/test_views.py index 4899c58..b809530 100644 --- a/engagements/tests/test_views.py +++ b/engagements/tests/test_views.py @@ -8,9 +8,10 @@ from django.urls import reverse from engagements import models, views from engagements.utils import populate_database +pytestmark = pytest.mark.django_db + @pytest.fixture -@pytest.mark.django_db def test_data(): return populate_database() @@ -54,6 +55,7 @@ def test_dscs_for_ep(client, test_data, request_factory): assert si2 in response.context["dscs"] assert si3 in response.context["dscs"] + @pytest.mark.django_db def test_get_blank_form(client, test_data, request_factory): url = reverse("engagements:effort_create", kwargs={"eid": 1, "etype": "PLANNING"}) @@ -61,4 +63,5 @@ def test_get_blank_form(client, test_data, request_factory): request = request_factory.get(url) request.user = test_data["superuser"] response = views.engagement_effort_create(request, eid=1, etype="PLANNING") - assert response.status_code == HTTPStatus.OK
\ No newline at end of file + assert response.status_code == HTTPStatus.OK + diff --git a/instruments/tests/test_models.py b/instruments/tests/test_models.py index 6346cba..7762dde 100644 --- a/instruments/tests/test_models.py +++ b/instruments/tests/test_models.py @@ -5,14 +5,14 @@ import pytest from engagements import models from engagements.utils import populate_database +pytestmark = pytest.mark.django_db + @pytest.fixture -@pytest.mark.django_db def test_data(): return populate_database() -@pytest.mark.django_db class TestModels: def test_check_all_dcs(self, test_data): dscs = test_data.get("sub_instruments") |