Coverage for tests/test_app/management/commands/dj_params2.py: 84%
17 statements
« prev ^ index » next coverage.py v7.3.4, created at 2024-01-20 18:02 +0000
« prev ^ index » next coverage.py v7.3.4, created at 2024-01-20 18:02 +0000
1from django.core.management import CommandError
3from django_typer import TyperCommand, command
4from django_typer.tests.utils import log_django_parameters
7class Command(TyperCommand):
8 help = "Test that django parameters work as expected"
10 @command()
11 def cmd1(self, throw: bool = False):
12 assert self.__class__ == Command
13 log_django_parameters(self)
14 if throw: 14 ↛ 15line 14 didn't jump to line 15, because the condition on line 14 was never true
15 raise CommandError("Test Exception")
17 @command()
18 def cmd2(self, throw: bool = False):
19 assert self.__class__ == Command
20 log_django_parameters(self)
21 if throw: 21 ↛ 22line 21 didn't jump to line 22, because the condition on line 21 was never true
22 raise CommandError("Test Exception")