IdHub/idhub/tests/test_templates.py

22 lines
751 B
Python
Raw Normal View History

from django.urls import reverse
from django.test import Client, TestCase
from idhub_auth.models import User
2024-01-29 11:05:23 +00:00
from django.conf import settings
class TemplateTest(TestCase):
def setUp(self):
self.client = Client()
self.admin_user = User.objects.create_superuser(
email='adminuser@example.org',
password='adminpass12')
2024-01-29 11:05:23 +00:00
self.admin_user.accept_gdpr=True
self.admin_user.save()
def test_dashboard_template(self):
self.client.login(email='adminuser@example.org', password='adminpass12')
response = self.client.get(reverse('idhub:admin_dashboard'))
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, 'idhub/base_admin.html')