コード例 #1
0
 def test_get_settings_module_name_error_if_empty(self):
     with mock.patch('settings_composer.environment.os') as _os:
         _os.environ = {
             constants.SETTINGS_MODULE_VARIABLE_NAME: ''
         }
         with self.assertRaises(ImproperlyConfigured):
             environment.get_settings_module_name()
コード例 #2
0
 def test_get_settings_module_name(self):
     with mock.patch('settings_composer.environment.os') as _os:
         _os.environ = {
             constants.SETTINGS_MODULE_VARIABLE_NAME: 'my.settings.module'
         }
         self.assertEqual(
             environment.get_settings_module_name(),
             'my.settings.module'
         )
コード例 #3
0
 def test_get_settings_module_name_error_if_none(self):
     with mock.patch('settings_composer.environment.os') as _os:
         _os.environ = {}
         with self.assertRaises(ImproperlyConfigured):
             environment.get_settings_module_name()