Fix the staticfiles_tests and django.conf to not think that None meant 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: http://code.djangoproject.com/svn/django/trunk@16310 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
9abe734b83
commit
06279e454a
|
@ -12,7 +12,7 @@ import time # Needed for Windows
|
||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
from django.conf import global_settings
|
from django.conf import global_settings
|
||||||
from django.utils.functional import LazyObject
|
from django.utils.functional import LazyObject, empty
|
||||||
from django.utils import importlib
|
from django.utils import importlib
|
||||||
|
|
||||||
ENVIRONMENT_VARIABLE = "DJANGO_SETTINGS_MODULE"
|
ENVIRONMENT_VARIABLE = "DJANGO_SETTINGS_MODULE"
|
||||||
|
@ -47,19 +47,19 @@ class LazySettings(LazyObject):
|
||||||
parameter sets where to retrieve any unspecified values from (its
|
parameter sets where to retrieve any unspecified values from (its
|
||||||
argument must support attribute access (__getattr__)).
|
argument must support attribute access (__getattr__)).
|
||||||
"""
|
"""
|
||||||
if self._wrapped != None:
|
if self._wrapped is not empty:
|
||||||
raise RuntimeError('Settings already configured.')
|
raise RuntimeError('Settings already configured.')
|
||||||
holder = UserSettingsHolder(default_settings)
|
holder = UserSettingsHolder(default_settings)
|
||||||
for name, value in options.items():
|
for name, value in options.items():
|
||||||
setattr(holder, name, value)
|
setattr(holder, name, value)
|
||||||
self._wrapped = holder
|
self._wrapped = holder
|
||||||
|
|
||||||
|
@property
|
||||||
def configured(self):
|
def configured(self):
|
||||||
"""
|
"""
|
||||||
Returns True if the settings have already been configured.
|
Returns True if the settings have already been configured.
|
||||||
"""
|
"""
|
||||||
return bool(self._wrapped)
|
return self._wrapped is not empty
|
||||||
configured = property(configured)
|
|
||||||
|
|
||||||
|
|
||||||
class BaseSettings(object):
|
class BaseSettings(object):
|
||||||
|
|
|
@ -14,6 +14,7 @@ from django.core.files.storage import default_storage
|
||||||
from django.core.management import call_command
|
from django.core.management import call_command
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
from django.utils.encoding import smart_unicode
|
from django.utils.encoding import smart_unicode
|
||||||
|
from django.utils.functional import empty
|
||||||
from django.utils._os import rmtree_errorhandler
|
from django.utils._os import rmtree_errorhandler
|
||||||
|
|
||||||
|
|
||||||
|
@ -61,7 +62,7 @@ class StaticFilesTestCase(TestCase):
|
||||||
# Clear the cached default_storage out, this is because when it first
|
# Clear the cached default_storage out, this is because when it first
|
||||||
# gets accessed (by some other test), it evaluates settings.MEDIA_ROOT,
|
# 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.
|
# 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
|
# To make sure SVN doesn't hangs itself with the non-ASCII characters
|
||||||
# during checkout, we actually create one file dynamically.
|
# during checkout, we actually create one file dynamically.
|
||||||
|
|
Loading…
Reference in New Issue