def test_cannot_redefine_setting(self):
    settings.test = 'Test settings'
    settings.test.setting = Setting('Test setting')
    with self.assertRaisesRegexp(ValueError, '^Settings cannot be redefined$'):
        settings.test.setting = Setting('Second assignment')
def test_cannot_redefine_setting(self):
    settings.test = 'Test settings'
    settings.test.setting = Setting('Test setting')
    with self.assertRaisesRegexp(ValueError, '^Settings cannot be redefined$'):
        settings.test.setting = Setting('Second assignment')