Ticket #10130: 10130-r10407.diff

File 10130-r10407.diff, 1.8 KB (added by jcassee, 6 years ago)
  • django/utils/functional.py

     
    281281                self._setup()
    282282            setattr(self._wrapped, name, value)
    283283
     284    def __delattr__(self, name):
     285        if name == "_wrapped":
     286            raise NotImplementedError()
     287        else:
     288            if self._wrapped is None:
     289                self._setup()
     290            delattr(self._wrapped, name)
     291
    284292    def _setup(self):
    285293        """
    286294        Must be implemented by subclasses to initialise the wrapped object.
  • tests/regressiontests/settings/tests.py

    Property changes on: tests/regressiontests/settings/__init__.py
    ___________________________________________________________________
    Added: svn:eol-style
       + native
    
     
     1import unittest
     2from django.conf import settings
     3
     4class SettingsTest(unittest.TestCase):
     5
     6    def testSetDelete(self):
     7        settings.TEST = 'test'
     8        del settings.TEST
Back to Top