Re: How to delete a setting

2009-06-08 Thread V
you can run ./manage.py test yourapp with --settings=mysetting so, I would recommend to create a settings file with the given setting left out V On Jun 7, 1:51 pm, Julien Phalip wrote: > Hi, > > In a unit test, I'd like to test the behaviour of a middleware in the > absence of a setting. To ma

Re: How to delete a setting

2009-06-07 Thread Alex Gaynor
On Sun, Jun 7, 2009 at 7:51 AM, Julien Phalip wrote: > > Hi, > > In a unit test, I'd like to test the behaviour of a middleware in the > absence of a setting. To make sure the setting is not present, I try > to delete it: > > def test_middleware(self): >if hasattr(settings, 'BLAH'): >

How to delete a setting

2009-06-07 Thread Julien Phalip
Hi, In a unit test, I'd like to test the behaviour of a middleware in the absence of a setting. To make sure the setting is not present, I try to delete it: def test_middleware(self): if hasattr(settings, 'BLAH'): delattr(settings, 'BLAH') response = self.client.get('