I have a Django custom command that can return non-zero exit codes. I'd like to test this command, but the call to sys.exit(1)
exits the test runner.
Is there a "proper" way to assign the exit code in a custom Django command?
My code currently looks like this:
# Exit with the appropriate return code
if len(result.failures) > 0 or len(result.errors) > 0:
sys.exit(1)