diff options
Diffstat (limited to 'tests/tests.py')
| -rw-r--r-- | tests/tests.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/tests/tests.py b/tests/tests.py index 6f9ed47..9ea13ed 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -2,6 +2,7 @@ from __future__ import absolute_import from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.test import TestCase +from django.test.utils import override_settings from .models import (AppConf, TestConf, PrefixConf, YetAnotherPrefixConf, SeparateConf, @@ -52,12 +53,8 @@ class TestConfTests(TestCase): def test_dir_members(self): custom_conf = TestConf() self.assertTrue('TESTS_SIMPLE_VALUE' in dir(settings)) - if hasattr(settings, '__members__'): # django 1.5 removed __members__ - self.assertTrue('TESTS_SIMPLE_VALUE' in settings.__members__) self.assertTrue('SIMPLE_VALUE' in dir(custom_conf)) - self.assertTrue('SIMPLE_VALUE' in custom_conf.__members__) self.assertFalse('TESTS_SIMPLE_VALUE' in dir(custom_conf)) - self.assertFalse('TESTS_SIMPLE_VALUE' in custom_conf.__members__) def test_custom_holder(self): CustomHolderConf() @@ -68,6 +65,18 @@ class TestConfTests(TestCase): self.assertTrue('TESTS_CONFIGURE_METHOD_VALUE2' in dir(settings)) self.assertEqual(settings.TESTS_CONFIGURE_METHOD_VALUE2, False) + # Pair of tests checking override_settings compat. + # See: + # https://github.com/django-compressor/django-appconf/issues/29 + # https://github.com/django-compressor/django-appconf/issues/30 + @override_settings(TESTS_SIMPLE_VALUE=False) + def test_override_settings_once(self): + self.assertEqual(settings.TESTS_SIMPLE_VALUE, False) + + @override_settings(TESTS_SIMPLE_VALUE=False) + def test_override_settings_twice(self): + self.assertEqual(settings.TESTS_SIMPLE_VALUE, False) + class PrefixConfTests(TestCase): |
