You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

20 lines
766 B

from django.test.utils import override_settings
from hc.test import BaseTestCase
class AddPrometheusTestCase(BaseTestCase):
def setUp(self):
super().setUp()
self.url = "/projects/%s/add_prometheus/" % self.project.code
def test_instructions_work(self):
self.client.login(username="[email protected]", password="password")
r = self.client.get(self.url)
self.assertContains(r, "Prometheus")
self.assertContains(r, f"{self.project.code}/metrics/")
@override_settings(PROMETHEUS_ENABLED=False)
def test_it_handles_disabled_integration(self):
self.client.login(username="[email protected]", password="password")
r = self.client.get(self.url)
self.assertEqual(r.status_code, 404)