summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCarlton Gibson <carlton.gibson@noumenal.co.uk>2016-04-19 21:17:43 +0200
committerCarlton Gibson <carlton.gibson@noumenal.co.uk>2016-04-19 21:17:43 +0200
commit7cfbe04ab82fd850d37544f5f7442275bdcb03c3 (patch)
tree6e8f5d135cdd0e8f2ad1bfcd945b3652769bb9aa /tests
parent75c8ca4fd610a1ca8a8ca971f87a29a5bf8331b8 (diff)
parentf48b3b84b18ad3d02674cef183cfe8ccfd36262a (diff)
downloaddjango-appconf-master.tar.gz
Merge pull request #33 from django-compressor/developv1.0.2master
Merge development changes for update on PyPI
Diffstat (limited to 'tests')
-rw-r--r--tests/tests.py17
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):