<commit_before>from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase

from geotrek.common.utils.signals import check_srid_has_meter_unit


class StartupCheckTest(TestCase):
    def test_error_is_raised_if_srid_is_not_meters(self):
        if hasattr(check_srid_has_meter_unit, '_checked'):
            delattr(check_srid_has_meter_unit, '_checked')
        with self.settings(SRID=4326):
            self.assertRaises(ImproperlyConfigured, check_srid_has_meter_unit)

    def test_error_is_not_raised_if_srid_is_meters(self):
        if hasattr(check_srid_has_meter_unit, '_checked'):
            delattr(check_srid_has_meter_unit, '_checked')
        with self.settings(SRID=2154):
            try:
                check_srid_has_meter_unit
            except ImproperlyConfigured:
                self.fail("check_srid_has_meter_unit raised ImproperlyConfigured exception unexpectedly")
<commit_msg>[IMP] KISS: simplify the code to get the same result<commit_after>from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase

from geotrek.common.utils.signals import check_srid_has_meter_unit


class StartupCheckTest(TestCase):
    def test_error_is_raised_if_srid_is_not_meters(self):
        if hasattr(check_srid_has_meter_unit, '_checked'):
            delattr(check_srid_has_meter_unit, '_checked')
        with self.settings(SRID=4326):
            self.assertRaises(ImproperlyConfigured, check_srid_has_meter_unit)

    def test_error_is_not_raised_if_srid_is_meters(self):
        if hasattr(check_srid_has_meter_unit, '_checked'):
            delattr(check_srid_has_meter_unit, '_checked')
        with self.settings(SRID=2154):
            check_srid_has_meter_unit

{'fraction_non_alphanumeric': 0.06769936890418818, 'fraction_numerical': 0.009179575444635685, 'mean_word_length': 4.205970149253731, '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': '6939118', 'n_tokens_mistral': 600, 'n_tokens_neox': 560, 'n_words': 87}