From 487d904bf253de2f5633f181a168f94086bcd6cb Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Tue, 5 Feb 2019 09:11:54 -0800 Subject: 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. --- tests/user_commands/tests.py | 3 --- 1 file changed, 3 deletions(-) (limited to 'tests/user_commands') diff --git a/tests/user_commands/tests.py b/tests/user_commands/tests.py index 25ab82baed..2d1f8f834d 100644 --- a/tests/user_commands/tests.py +++ b/tests/user_commands/tests.py @@ -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"', -- cgit v1.3