import unittest
import cbs


class AttrSettings():
    PROJECT_NAME = 'fancy_project'


class MethodSettings():
    def PROJECT_NAME(self):
        return 'fancy_project'


class TestApply(unittest.TestCase):

    def test_apply_settings_attr(self):
        g = {}
        cbs.apply(AttrSettings, g)

        self.assertEqual(g['PROJECT_NAME'], 'fancy_project')

    def test_apply_settings_method(self):
        g = {}
        cbs.apply(MethodSettings, g)

        self.assertEqual(g['PROJECT_NAME'], 'fancy_project')

    def test_apply_settings_string_reference(self):
        g = {}
        cbs.apply(__name__ + '.AttrSettings', g)

        self.assertEqual(g['PROJECT_NAME'], 'fancy_project')

    def test_apply_settings_invalid_string_reference(self):
        self.assertRaises(ImportError, cbs.apply, 'invalid.Class', {})

@@ -505,32 +505,223 @@
 ancy_project')%0A%0A
+    def test_apply_settings_string_local(self):%0A        g = %7B'AttrSettings': AttrSettings%7D%0A        cbs.apply('AttrSettings', g)%0A%0A        self.assertEqual(g%5B'PROJECT_NAME'%5D, 'fancy_project')%0A%0A
     def test_app
@@ -875,32 +875,159 @@
 ancy_project')%0A%0A
+    def test_apply_settings_invalid_string_local(self):%0A        self.assertRaises(ValueError, cbs.apply, 'LocalSettings', %7B%7D)%0A%0A
     def test_app

Test all the code paths