1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Cleaned up temporary test directories in tests.

This commit is contained in:
Mariusz Felisiak
2024-07-21 07:44:38 +02:00
committed by Sarah Boyce
parent 2ff917fd06
commit b06cf62c88
3 changed files with 10 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
import datetime
import os
import shutil
from decimal import Decimal
from unittest import mock, skipUnless
@@ -72,6 +73,7 @@ from .models import (
Triple,
Writer,
WriterProfile,
temp_storage_dir,
test_images,
)
@@ -2482,6 +2484,12 @@ class ModelOneToOneFieldTests(TestCase):
class FileAndImageFieldTests(TestCase):
def setUp(self):
if os.path.exists(temp_storage_dir):
shutil.rmtree(temp_storage_dir)
os.mkdir(temp_storage_dir)
self.addCleanup(shutil.rmtree, temp_storage_dir)
def test_clean_false(self):
"""
If the ``clean`` method on a non-required FileField receives False as