healthchecks_healthchecks/hc/front/tests/test_projects_menu.py
2023-08-30 09:57:34 +03:00

23 lines
638 B
Python

from __future__ import annotations
from hc.test import BaseTestCase
class ProjectsMenuTestCase(BaseTestCase):
def setUp(self) -> None:
super().setUp()
self.url = "/projects/menu/"
def test_it_works(self) -> None:
self.client.login(username="alice@example.org", password="password")
r = self.client.get(self.url)
self.assertEqual(r.status_code, 200)
self.assertContains(r, "Alices Project")
self.assertContains(r, "status ic-up")
def test_it_requires_logged_in_user(self) -> None:
r = self.client.get(self.url)
self.assertEqual(r.status_code, 302)