コード例 #1
0
 def test_get_setting(self):
     """get_setting should get the setting from the database."""
     widget = DummyWidget()
     setting = widget.get_setting('IS_ENABLED')
     self.assertEqual(setting, None, msg=(
         'Should return None if the setting does not exist in the db'))
     widget.save_setting('IS_ENABLED', '1')
     setting = widget.get_setting('IS_ENABLED')
     self.assertEqual(setting.setting_name, 'IS_ENABLED', msg=(
         'Should return the correct setting from the database when called'))