diff --git a/src/consents/tests/tests_consent_operations.py b/src/consents/tests/tests_consent_operations.py index a9b4fe03273483cd48de0e7d9a217215c75f4d38..6b1ad2261a3e937fc0d7a831774d675d81043617 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 1e2b819eb14340e6c488e20b4f3690dc9c7f627f..ffed8a125c057a644444c6a5ede06e94c303de4e 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 d0f89c4b9548cdd1b6bfac40c0c9c9d0b5ecc501..4ed28668b05e52adc681a4789876e5e3d96b21cc 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 )