Implement test coverage for app

This commit is contained in:
2025-10-03 22:43:16 -04:00
parent 1e1ed287b5
commit 641ab6be67
5 changed files with 129 additions and 6 deletions

View File

@@ -19,13 +19,13 @@ class BackerTestCase(TestCase):
backer = ConfigBackedUAList()
from django.conf import settings
if not settings.configured:
if not settings.configured: # pragma: no cover
raise Exception("Django settings not configured")
if not hasattr(settings, "AI_BLOCKER_CONF"):
if not hasattr(settings, "AI_BLOCKER_CONF"): # pragma: no cover
raise Exception("AI_BLOCKER_CONF not configured")
if not "ua_list" in settings.AI_BLOCKER_CONF or not len(settings.AI_BLOCKER_CONF['ua_list']) > 0:
if not "ua_list" in settings.AI_BLOCKER_CONF or not len(settings.AI_BLOCKER_CONF['ua_list']) > 0: # pragma: no cover
raise Exception("AI_BLOCKER_CONF.ua_list not configured")
self.assertGreater(len(backer.get_ua_list()), 0)