diff options
Diffstat (limited to 'tests/file_uploads/tests.py')
| -rw-r--r-- | tests/file_uploads/tests.py | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/tests/file_uploads/tests.py b/tests/file_uploads/tests.py index 7bc8d41dac..8b5d1de26f 100644 --- a/tests/file_uploads/tests.py +++ b/tests/file_uploads/tests.py @@ -58,11 +58,7 @@ class FileUploadTests(TestCase): def setUpClass(cls): super().setUpClass() os.makedirs(MEDIA_ROOT, exist_ok=True) - - @classmethod - def tearDownClass(cls): - shutil.rmtree(MEDIA_ROOT) - super().tearDownClass() + cls.addClassCleanup(shutil.rmtree, MEDIA_ROOT) def test_upload_name_is_validated(self): candidates = [ @@ -678,11 +674,7 @@ class DirectoryCreationTests(SimpleTestCase): def setUpClass(cls): super().setUpClass() os.makedirs(MEDIA_ROOT, exist_ok=True) - - @classmethod - def tearDownClass(cls): - shutil.rmtree(MEDIA_ROOT) - super().tearDownClass() + cls.addClassCleanup(shutil.rmtree, MEDIA_ROOT) def setUp(self): self.obj = FileModel() |
