mirror of
https://github.com/healthchecks/healthchecks.git
synced 2024-11-21 15:17:57 +00:00
13f92b90ef
And add it to docs. And add a system check to make sure it, if set, is a tuple with 2 elements. cc: #851
25 lines
905 B
Python
25 lines
905 B
Python
from __future__ import annotations
|
|
|
|
from django.test.utils import override_settings
|
|
|
|
from hc.api.apps import settings_check
|
|
from hc.test import BaseTestCase
|
|
|
|
|
|
@override_settings(EMAIL_HOST="localhost")
|
|
class SystemChecksCase(BaseTestCase):
|
|
@override_settings(SITE_ROOT="example.com")
|
|
def test_it_validates_site_root(self) -> None:
|
|
ids = [item.id for item in settings_check(None, None)]
|
|
self.assertEqual(ids, ["hc.api.W001"])
|
|
|
|
@override_settings(EMAIL_HOST=None)
|
|
def test_it_warns_about_missing_smtp_credentials(self) -> None:
|
|
ids = [item.id for item in settings_check(None, None)]
|
|
self.assertEqual(ids, ["hc.api.W002"])
|
|
|
|
@override_settings(SECURE_PROXY_SSL_HEADER="abc")
|
|
def test_it_checks_secure_proxy_ssl_header_tupleness(self) -> None:
|
|
ids = [item.id for item in settings_check(None, None)]
|
|
self.assertEqual(ids, ["hc.api.W003"])
|