Re: `call_command` raises ValueError during testing

2022-10-03 Thread Ferran Jovell
Hi Tim, As far as I understand, when adding an argument with `argparser` without dashes, argparse interprets it as a positional argument and not an option, which is how it works when you call it from the terminal. However, calling `call_command` with args instead of keyword arguments seems to skip

Re: `call_command` raises ValueError during testing

2022-10-02 Thread Tim Graham
Hi Ferran, It looks like opt.option_strings is empty because "poll_ids" (in parser.add_argument()) isn't prefixed with a dash or double dash. You could instead use call_command() like this: call_command("closepoll", 1) But I think your invocation could be fixed (or at least not fail so obscur

`call_command` raises ValueError during testing

2022-10-02 Thread Ferran Jovell
Hello everyone, I was working on a admin command today, and when setting up tests and fixtures for running the command during testing I found this error: Traceback (most recent call last): File "/home/fjm/code/django-stuff/tutorial/polls/tests.py", line 10, in test_command_output call_comma