2023-11-24 14:23:59 +00:00
|
|
|
from django.urls import reverse
|
|
|
|
from django.test import Client, TestCase
|
|
|
|
|
|
|
|
from idhub_auth.models import User
|
|
|
|
|
|
|
|
|
|
|
|
class TemplateTest(TestCase):
|
|
|
|
def setUp(self):
|
|
|
|
self.client = Client()
|
|
|
|
self.admin_user = User.objects.create_superuser(
|
2023-11-27 10:26:23 +00:00
|
|
|
email='adminuser@example.org',
|
2023-11-24 14:23:59 +00:00
|
|
|
password='adminpass12')
|
|
|
|
|
|
|
|
def test_dashboard_template(self):
|
2023-11-27 10:26:23 +00:00
|
|
|
self.client.login(email='adminuser@example.org', password='adminpass12')
|
2023-11-24 14:23:59 +00:00
|
|
|
response = self.client.get(reverse('idhub:admin_dashboard'))
|
|
|
|
self.assertEqual(response.status_code, 200)
|
|
|
|
self.assertTemplateUsed(response, 'idhub/base_admin.html')
|