<commit_before>from django.test import TestCase
from dojo.models import System_Settings


class TestSystemSettings(TestCase):

    def test_system_settings_update(self):
        system_settings = System_Settings.objects.get()
        system_settings.enable_jira = True
        system_settings.save()
        system_settings = System_Settings.objects.get()
        self.assertEquals(system_settings.enable_jira, True)<commit_msg>unittests: check for existence of system_settings db record (#2105)<commit_after>from django.test import TestCase
from dojo.models import System_Settings


class TestSystemSettings(TestCase):

    def test_system_settings_update(self):
        try:
            # although the unittests are run after initial data has been loaded, for some reason in travis sometimes the settings aren't present
            system_settings = System_Settings.objects.get()
        except System_Settings.DoesNotExistDoesNotExist:
            system_settings = System_Settings()

        system_settings.enable_jira = True
        system_settings.save()
        system_settings = System_Settings.objects.get()
        self.assertEquals(system_settings.enable_jira, True)
{'fraction_non_alphanumeric': 0.0636672325976231, 'fraction_numerical': 0.003395585738539898, 'mean_word_length': 3.8518518518518516, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1544182', 'n_tokens_mistral': 309, 'n_tokens_neox': 297, 'n_words': 75}