forked from DefectDojo/django-DefectDojo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_system_settings.py
27 lines (21 loc) · 1.04 KB
/
test_system_settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from .dojo_test_case import DojoTestCase
from dojo.models import System_Settings
class TestSystemSettings(DojoTestCase):
def test_system_settings_update(self):
try:
# although the unittests are run after initial data has been loaded, for some reason in cicd sometimes the settings aren't present
system_settings = System_Settings.objects.get()
except System_Settings.DoesNotExist:
system_settings = System_Settings()
system_settings.enable_jira = True
system_settings.save()
system_settings = System_Settings.objects.get()
self.assertEqual(system_settings.enable_jira, True)
system_settings.enable_jira = False
system_settings.save()
system_settings = System_Settings.objects.get()
self.assertEqual(system_settings.enable_jira, False)
system_settings.enable_jira = True
system_settings.save()
system_settings = System_Settings.objects.get(no_cache=True)
self.assertEqual(system_settings.enable_jira, True)