test: Patch environment to increase test stability

This commit is contained in:
Georg Krause 2024-01-22 13:12:18 +00:00 committed by upsiflu
parent 5ec89f5999
commit 5a48e67a4a
1 changed files with 2 additions and 1 deletions

View File

@ -117,7 +117,8 @@ commands = ["createsuperuser", "makemigrations"]
@pytest.mark.parametrize("command", commands)
def test_blocked_commands(command):
def test_blocked_commands(command, mocker):
mocker.patch.dict(os.environ, {"FORCE": "0"})
with pytest.raises(CommandError):
call_command(command)