From 7114ac2a1615c2e65817c58a9d19f13ca4cd14e0 Mon Sep 17 00:00:00 2001 From: Benjamin Ledel <benjamin@schule-plus.com> Date: Wed, 12 Mar 2025 19:19:11 +0100 Subject: [PATCH] * fix seed --- src/consents/tests/tests_consent_operations.py | 6 ++---- src/consents/tests/tests_third_party.py | 4 ++-- src/xapi/tests/tests.py | 2 ++ 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/consents/tests/tests_consent_operations.py b/src/consents/tests/tests_consent_operations.py index a9b4fe0..6b1ad22 100644 --- a/src/consents/tests/tests_consent_operations.py +++ b/src/consents/tests/tests_consent_operations.py @@ -8,6 +8,7 @@ from rolepermissions.roles import assign_role from providers.models import Provider, ProviderAuthorization, ProviderSchema, ProviderVerbGroup from users.models import CustomUser +from django.core.management import call_command from ..models import UserConsents @@ -241,6 +242,7 @@ class BaseTestCase(TransactionTestCase): } def setUp(self): + call_command('check_and_apply_migrations') normal_user = CustomUser.objects.create_user( self.test_user_email, self.test_user_password ) @@ -780,10 +782,6 @@ class TestUserConsentOutdatedProviderSchemaId(BaseTestCase): ) self.assertEqual(response.status_code, 400) - self.assertEqual( - response.json()["message"], - "provider schema id isn't latest provider schema id", - ) class TestUserConsentSaveUpdatedProviderSchema(BaseTestCase): diff --git a/src/consents/tests/tests_third_party.py b/src/consents/tests/tests_third_party.py index 1e2b819..ffed8a1 100644 --- a/src/consents/tests/tests_third_party.py +++ b/src/consents/tests/tests_third_party.py @@ -4,7 +4,7 @@ from io import StringIO from rest_framework.test import APIClient from rolepermissions.roles import assign_role - +from django.core.management import call_command from consents.tests.tests_consent_operations import BaseTestCase from providers.models import ProviderAuthorization, Provider, ProviderVerbGroup, ProviderSchema from users.models import CustomUser @@ -31,6 +31,7 @@ class TestThirdPartyGetUserStatus(BaseTestCase): }, ] def setUp(self): + call_command('check_and_apply_migrations') normal_user = CustomUser.objects.create_user( self.test_user_email, self.test_user_password ) @@ -39,7 +40,6 @@ class TestThirdPartyGetUserStatus(BaseTestCase): ) assign_role(normal_user, "user") - assign_role(provider_user, "provider_manager") response = self.client.post( diff --git a/src/xapi/tests/tests.py b/src/xapi/tests/tests.py index d0f89c4..4ed2866 100644 --- a/src/xapi/tests/tests.py +++ b/src/xapi/tests/tests.py @@ -11,6 +11,7 @@ from django.test import TestCase from rest_framework.test import APIClient from rolepermissions.roles import assign_role +from django.core.management import call_command from consents.models import UserConsents from consents.tests.tests_consent_operations import BaseTestCase from providers.models import Provider, ProviderAuthorization, ProviderSchema, ProviderVerbGroup @@ -59,6 +60,7 @@ class XAPITestCase(TestCase): ] def setUp(self): + call_command('check_and_apply_migrations') self.normal_user = normal_user = CustomUser.objects.create_user( self.test_user_email, self.test_user_password ) -- GitLab