diff --git a/configurations/tests/settings/mixin_inheritance.py b/configurations/tests/settings/mixin_inheritance.py new file mode 100644 index 0000000..9421588 --- /dev/null +++ b/configurations/tests/settings/mixin_inheritance.py @@ -0,0 +1,25 @@ +from configurations import Settings + + +class Mixin1(object): + + @property + def TEMPLATE_CONTEXT_PROCESSORS(self): + return super(Mixin1, self).TEMPLATE_CONTEXT_PROCESSORS + ( + 'some_app.context_processors.processor1',) + + +class Mixin2(object): + + @property + def TEMPLATE_CONTEXT_PROCESSORS(self): + return super(Mixin2, self).TEMPLATE_CONTEXT_PROCESSORS + ( + 'some_app.context_processors.processor2',) + + +class Inheritance(Mixin2, Mixin1, Settings): + + @property + def TEMPLATE_CONTEXT_PROCESSORS(self): + return super(Inheritance, self).TEMPLATE_CONTEXT_PROCESSORS + ( + 'some_app.context_processors.processorbase',) diff --git a/configurations/tests/test_inheritance.py b/configurations/tests/test_inheritance.py index 8b202d4..545f42d 100644 --- a/configurations/tests/test_inheritance.py +++ b/configurations/tests/test_inheritance.py @@ -28,3 +28,15 @@ class InheritanceTests(TestCase): 'configurations.tests.settings.base.test_callback', 'configurations.tests.settings.base.test_callback', )) + + @patch.dict(os.environ, clear=True, + DJANGO_CONFIGURATION='Inheritance', + DJANGO_SETTINGS_MODULE='configurations.tests.settings.mixin_inheritance') + def test_inherited3(self): + from configurations.tests.settings import mixin_inheritance + self.assertEquals(mixin_inheritance.TEMPLATE_CONTEXT_PROCESSORS, + global_settings.TEMPLATE_CONTEXT_PROCESSORS + ( + 'some_app.context_processors.processor1', + 'some_app.context_processors.processor2', + 'some_app.context_processors.processorbase', + ))