healthchecks_healthchecks/hc/api/tests/__init__.py
2023-10-25 18:12:12 +03:00

20 lines
600 B
Python

from __future__ import annotations
from typing import Any
from django.conf import settings
from django.test.runner import DiscoverRunner
class CustomRunner(DiscoverRunner):
def __init__(self, *args: Any, **kwargs: Any) -> None:
# For speed:
settings.PASSWORD_HASHERS = ("django.contrib.auth.hashers.MD5PasswordHasher",)
# Send emails synchronously
settings.BLOCKING_EMAILS = True
# Make sure EMAIL_HOST is set as hc.lib.emails.send() requires it
settings.EMAIL_HOST = "example.org"
super(CustomRunner, self).__init__(*args, **kwargs)