From 392898c6a55cedf5d93a155396c9327de7bf9f80 Mon Sep 17 00:00:00 2001 From: Jiri Barton Date: Wed, 25 Aug 2010 15:08:07 +0200 Subject: [PATCH] moved settings --- .hgignore | 5 ++++- tests/test_settings.py | 11 ++++++++--- tests/tests.py | 12 +----------- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/.hgignore b/.hgignore index 5e0565f..6ccc113 100644 --- a/.hgignore +++ b/.hgignore @@ -2,4 +2,7 @@ syntax: regexp ^\.project$ syntax: regexp -^\.pydevproject$ \ No newline at end of file +^\.pydevproject$ +syntax: glob +*.pyc +*.egg-info diff --git a/tests/test_settings.py b/tests/test_settings.py index 47c64fd..ac3a090 100644 --- a/tests/test_settings.py +++ b/tests/test_settings.py @@ -4,11 +4,16 @@ DATABASES = { } } - -CONSTANCE_CONNECTION_CLASS = 'tests.redis_mockup.Connection' - INSTALLED_APPS = ( 'tests', 'constance', ) +CONSTANCE_CONNECTION_CLASS = 'tests.redis_mockup.Connection' + +CONSTANCE_CONFIG = { + 'INT_VALUE': (1, 'some int'), + 'BOOL_VALUE': (True, 'true or false'), + 'STRING_VALUE': ('Hello world', 'greetings'), +} + diff --git a/tests/tests.py b/tests/tests.py index 128d8f9..936db98 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -7,13 +7,7 @@ from constance import config class TestStorage(TestCase): - def setUp(self): - self.old_config = getattr(settings, 'CONSTANCE_CONFIG', None) - settings.CONSTANCE_CONFIG = { - 'INT_VALUE': (1, 'some int'), - 'BOOL_VALUE': (True, 'true or false'), - 'STRING_VALUE': ('Hello world', 'greetings'), - } + def tearDown(self): config._rd.clear() def test_store(self): @@ -43,7 +37,3 @@ class TestStorage(TestCase): except Exception, e: pass self.assertEquals(type(e), AttributeError) - - def tearDown(self): - if self.old_config: - settings.CONSTANCE_CONFIG = self.old_config