summaryrefslogtreecommitdiff
path: root/tests/admin_scripts
diff options
context:
space:
mode:
authorJacob Walls <jacobtylerwalls@gmail.com>2024-11-29 07:04:48 -0500
committerGitHub <noreply@github.com>2024-11-29 09:04:48 -0300
commit58cc91275a68bb42780cf0e663dad9ecf49039de (patch)
treee60317923d4f2faf61238f46528ed180a5134651 /tests/admin_scripts
parent978aae4334fa71ba78a3e94408f0f3aebde8d07c (diff)
Fixed #35308 -- Handled OSError when launching code formatters.
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
Diffstat (limited to 'tests/admin_scripts')
-rw-r--r--tests/admin_scripts/tests.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py
index 6fdd873661..3145723920 100644
--- a/tests/admin_scripts/tests.py
+++ b/tests/admin_scripts/tests.py
@@ -16,6 +16,8 @@ import unittest
from io import StringIO
from unittest import mock
+from user_commands.utils import AssertFormatterFailureCaughtContext
+
from django import conf, get_version
from django.conf import settings
from django.core.management import (
@@ -2943,6 +2945,16 @@ class StartProject(LiveServerTestCase, AdminScriptTestCase):
expected_mode,
)
+ def test_failure_to_format_code(self):
+ with AssertFormatterFailureCaughtContext(self) as ctx:
+ call_command(
+ "startapp",
+ "mynewapp",
+ directory=self.test_dir,
+ stdout=ctx.stdout,
+ stderr=ctx.stderr,
+ )
+
class StartApp(AdminScriptTestCase):
def test_invalid_name(self):