Browse files

Fix the staticfiles_tests and django.conf to not think that None mean…

…t a lazy object hadn't been evaluated. Thanks to Jannis for informing me that I broke the test suite (if you were harmed by this I'll buy you a cookie). Sorry.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
Alex Alex
Alex authored and Alex committed Jun 1, 2011
1 parent afba843 commit 7fe8c98d30a0f8acbcd04152c886844f86708adc
Showing with 6 additions and 5 deletions.
  1. +4 −4 django/conf/
  2. +2 −1 tests/regressiontests/staticfiles_tests/
@@ -12,7 +12,7 @@
import warnings
from django.conf import global_settings
-from django.utils.functional import LazyObject
+from django.utils.functional import LazyObject, empty
from django.utils import importlib
@@ -47,19 +47,19 @@ def configure(self, default_settings=global_settings, **options):
parameter sets where to retrieve any unspecified values from (its
argument must support attribute access (__getattr__)).
- if self._wrapped != None:
+ if self._wrapped is not empty:
raise RuntimeError('Settings already configured.')
holder = UserSettingsHolder(default_settings)
for name, value in options.items():
setattr(holder, name, value)
self._wrapped = holder
+ @property
def configured(self):
Returns True if the settings have already been configured.
- return bool(self._wrapped)
- configured = property(configured)
+ return self._wrapped is not empty
class BaseSettings(object):
@@ -14,6 +14,7 @@
from import call_command
from django.test import TestCase
from django.utils.encoding import smart_unicode
+from django.utils.functional import empty
from django.utils._os import rmtree_errorhandler
@@ -61,7 +62,7 @@ def setUp(self):
# Clear the cached default_storage out, this is because when it first
# gets accessed (by some other test), it evaluates settings.MEDIA_ROOT,
# since we're planning on changing that we need to clear out the cache.
- default_storage._wrapped = None
+ default_storage._wrapped = empty
# To make sure SVN doesn't hangs itself with the non-ASCII characters
# during checkout, we actually create one file dynamically.

0 comments on commit 7fe8c98

Please sign in to comment.