Don't try to make a keypair during tests

pull/30/head
Andrew Godwin 2022-11-20 23:07:57 -07:00
rodzic f20cd3eb15
commit da936cd7df
3 zmienionych plików z 9 dodań i 3 usunięć

Wyświetl plik

@ -118,3 +118,5 @@ AUTO_ADMIN_EMAIL: Optional[str] = None
STATOR_TOKEN: Optional[str] = None
SENTRY_ENABLED = False
IN_TESTS = False

Wyświetl plik

@ -2,3 +2,5 @@ from .base import * # noqa
# Fixed secret key
SECRET_KEY = "testing_secret"
IN_TESTS = True

Wyświetl plik

@ -1,4 +1,5 @@
from django.apps import AppConfig
from django.conf import settings
class UsersConfig(AppConfig):
@ -6,7 +7,8 @@ class UsersConfig(AppConfig):
name = "users"
def ready(self) -> None:
# Generate the server actor keypair if needed
from users.models import SystemActor
if not settings.IN_TESTS:
# Generate the server actor keypair if needed
from users.models import SystemActor
SystemActor.generate_keys_if_needed()
SystemActor.generate_keys_if_needed()