fix tests

This commit is contained in:
Cayo Puigdefabregas 2024-03-19 11:00:22 +01:00
parent ca64247f1b
commit 46cd29f931
2 changed files with 7 additions and 0 deletions

View File

@ -36,6 +36,7 @@ class KeyFirstTimeTest(TestCase):
settings.DOMAIN = self.org.name settings.DOMAIN = self.org.name
settings.ENABLE_EMAIL = False settings.ENABLE_EMAIL = False
settings.LANGUAGE_CODE = 'en'
def set_cache(self): def set_cache(self):
cache.set("KEY_DIDS", '1234', None) cache.set("KEY_DIDS", '1234', None)
@ -94,6 +95,7 @@ class CredentialsViewTest(TestCase):
settings.DOMAIN = self.org.name settings.DOMAIN = self.org.name
settings.ENABLE_EMAIL = False settings.ENABLE_EMAIL = False
settings.LANGUAGE_CODE = 'en'
self.admin_login() self.admin_login()
self.create_schemas() self.create_schemas()

View File

@ -12,6 +12,7 @@ from django.core.exceptions import FieldError
from idhub_auth.models import User from idhub_auth.models import User
from idhub.admin.tables import DashboardTable, UserTable, TemplateTable from idhub.admin.tables import DashboardTable, UserTable, TemplateTable
from idhub.models import Event, Membership, Rol, UserRol, Service, Schemas from idhub.models import Event, Membership, Rol, UserRol, Service, Schemas
from oidc4vp.models import Organization
class AdminDashboardTableTest(TestCase): class AdminDashboardTableTest(TestCase):
@ -22,6 +23,10 @@ class AdminDashboardTableTest(TestCase):
password='adminpass12') password='adminpass12')
self.admin_user.accept_gdpr=True self.admin_user.accept_gdpr=True
self.admin_user.save() self.admin_user.save()
self.org = Organization.objects.create(name="testserver", main=True)
settings.LANGUAGE_CODE = 'en'
settings.DOMAIN = self.org.name
settings.ENABLE_EMAIL = False
@classmethod @classmethod
def setUpTestData(cls): def setUpTestData(cls):