[1.7.x] Fixed monkeypatching in a staticfiles test.

Backport of a4553e0510 from master
This commit is contained in:
Florian Apolloner 2014-04-21 14:51:52 +02:00 committed by Tim Graham
parent 62eb79fc4c
commit d7de6ed07e
1 changed files with 4 additions and 2 deletions

View File

@ -279,14 +279,16 @@ class TestConfiguration(StaticFilesTestCase):
command = collectstatic.Command()
self.assertFalse(command.is_local_storage())
storage.staticfiles_storage = storage.FileSystemStorage()
collectstatic.staticfiles_storage = storage.FileSystemStorage()
command = collectstatic.Command()
self.assertTrue(command.is_local_storage())
storage.staticfiles_storage = DummyStorage()
collectstatic.staticfiles_storage = DummyStorage()
command = collectstatic.Command()
self.assertFalse(command.is_local_storage())
finally:
staticfiles_storage._wrapped = empty
collectstatic.staticfiles_storage = staticfiles_storage
storage.staticfiles_storage = staticfiles_storage