Adds tests

This commit is contained in:
Mouse Reeve 2023-11-20 10:23:59 -08:00
parent c2742b4d80
commit 179dbd75aa

View file

@ -86,3 +86,25 @@ class AdminThemesViews(TestCase):
with self.assertRaises(PermissionDenied):
view(request)
def test_test_theme(self):
"""Testing testing testing test"""
theme = models.Theme.objects.first()
self.assertIsNone(theme.loads)
request = self.factory.post("")
request.user = self.local_user
views.test_theme(request, theme.id)
theme.refresh_from_db()
self.assertTrue(theme.loads)
def test_test_theme_broken(self):
"""Testing test for testing when it's a bad theme"""
theme = models.Theme.objects.create(name="bad theme", path="dsf/sdf/sdf.sdf")
self.assertIsNone(theme.loads)
request = self.factory.post("")
request.user = self.local_user
views.test_theme(request, theme.id)
theme.refresh_from_db()
self.assertFalse(theme.loads)