Refs #31546, Refs #34118 -- Corrected CommandTests.test_requires_system_checks_specific().

System checks are never called without skip_checks=False. Moreover,
called_once_with() is not a proper assertion and raise AttributeError
on Python 3.12.
This commit is contained in:
Mariusz Felisiak 2023-01-11 05:36:40 +01:00 committed by GitHub
parent d4b4c1cae4
commit 829f4d1448
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -199,8 +199,8 @@ class CommandTests(SimpleTestCase):
with mock.patch(
"django.core.management.base.BaseCommand.check"
) as mocked_check:
management.call_command("specific_system_checks")
mocked_check.called_once_with(tags=[Tags.staticfiles, Tags.models])
management.call_command("specific_system_checks", skip_checks=False)
mocked_check.assert_called_once_with(tags=[Tags.staticfiles, Tags.models])
def test_requires_system_checks_invalid(self):
class Command(BaseCommand):