def test_suit_config_when_defined_but_no_key(self):
     settings.SUIT_CONFIG = {'RANDOM_KEY': 123}
     default_suit_config = default_config()
     self.assertEqual(get_config('ADMIN_NAME'),
                      default_suit_config['ADMIN_NAME'])
     # Defined as empty, should stay empty
     admin_name = ''
     settings.SUIT_CONFIG = {'ADMIN_NAME': admin_name}
     self.assertEqual(get_config('ADMIN_NAME'), admin_name)
Beispiel #2
0
 def test_suit_config_when_defined_but_no_key(self):
     settings.SUIT_CONFIG = {
         'RANDOM_KEY': 123
     }
     default_suit_config = default_config()
     self.assertEqual(get_config('ADMIN_NAME'),
                      default_suit_config['ADMIN_NAME'])
     # Defined as empty, should stay empty
     admin_name = ''
     settings.SUIT_CONFIG = {
         'ADMIN_NAME': admin_name
     }
     self.assertEqual(get_config('ADMIN_NAME'), admin_name)
    def test_suit_config_when_not_defined(self):
        try:
            del settings.SUIT_CONFIG
        except AttributeError:
            pass
        default_suit_config = default_config()
        self.assertEqual(get_config('ADMIN_NAME'),
                         default_suit_config['ADMIN_NAME'])

        # Defined as None, should also use fallback
        admin_name = None
        settings.SUIT_CONFIG = {'ADMIN_NAME': admin_name}
        self.assertEqual(get_config('ADMIN_NAME'),
                         default_suit_config['ADMIN_NAME'])
Beispiel #4
0
    def test_suit_config_when_not_defined(self):
        try:
            del settings.SUIT_CONFIG
        except AttributeError:
            pass
        default_suit_config = default_config()
        self.assertEqual(get_config('ADMIN_NAME'),
                         default_suit_config['ADMIN_NAME'])

        # Defined as None, should also use fallback
        admin_name = None
        settings.SUIT_CONFIG = {
            'ADMIN_NAME': admin_name
        }
        self.assertEqual(get_config('ADMIN_NAME'),
                         default_suit_config['ADMIN_NAME'])
Beispiel #5
0
 def test_default_config(self):
     default_suit_config = default_config()
     self.assertEqual(VERSION, default_suit_config['VERSION'])
 def test_default_config(self):
     default_suit_config = default_config()
     self.assertEqual(VERSION, default_suit_config['VERSION'])