mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Simplified temporary directory handling in AdminScriptTestCase.
Use tempfile.TemporaryDirectory() in AdminScriptTestCase.setUp() to create and destroy a temporary directory for each test. It removes the need for individual tests to delete files. For test classes that don't use the temporary directory, inherit from SimpleTestCase.
This commit is contained in:
@@ -234,9 +234,6 @@ class CommandRunTests(AdminScriptTestCase):
|
||||
"""
|
||||
Tests that need to run by simulating the command line, not by call_command.
|
||||
"""
|
||||
def tearDown(self):
|
||||
self.remove_settings('settings.py')
|
||||
|
||||
def test_script_prefix_set_in_commands(self):
|
||||
self.write_settings('settings.py', apps=['user_commands'], sdict={
|
||||
'ROOT_URLCONF': '"user_commands.urls"',
|
||||
|
||||
Reference in New Issue
Block a user