From d89f56dc4d03f6bf6602536b8b62602ec0d46d2f Mon Sep 17 00:00:00 2001 From: Thomas Chaumeny Date: Sat, 18 Oct 2014 20:03:10 +0200 Subject: Fixed #21281 -- Made override_settings act at class level when used as a TestCase decorator. --- tests/file_uploads/tests.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/file_uploads') diff --git a/tests/file_uploads/tests.py b/tests/file_uploads/tests.py index fe1a79fc9f..4fa75415ec 100644 --- a/tests/file_uploads/tests.py +++ b/tests/file_uploads/tests.py @@ -33,12 +33,14 @@ class FileUploadTests(TestCase): @classmethod def setUpClass(cls): + super(FileUploadTests, cls).setUpClass() if not os.path.isdir(MEDIA_ROOT): os.makedirs(MEDIA_ROOT) @classmethod def tearDownClass(cls): shutil.rmtree(MEDIA_ROOT) + super(FileUploadTests, cls).tearDownClass() def test_simple_upload(self): with open(__file__, 'rb') as fp: @@ -494,12 +496,14 @@ class DirectoryCreationTests(TestCase): """ @classmethod def setUpClass(cls): + super(DirectoryCreationTests, cls).setUpClass() if not os.path.isdir(MEDIA_ROOT): os.makedirs(MEDIA_ROOT) @classmethod def tearDownClass(cls): shutil.rmtree(MEDIA_ROOT) + super(DirectoryCreationTests, cls).tearDownClass() def setUp(self): self.obj = FileModel() -- cgit v1.3