mirror of
https://github.com/django/django.git
synced 2025-11-24 21:00:12 +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:
parent
099c36d546
commit
487d904bf2
5 changed files with 30 additions and 140 deletions
|
|
@ -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"',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue