mirror of
https://github.com/ansible/awx.git
synced 2026-05-10 02:47:36 -02:30
Fix so command tests will work on Django 1.4.x.
This commit is contained in:
@@ -146,6 +146,10 @@ class BaseCommandTest(BaseTest):
|
|||||||
sys.stdin = original_stdin
|
sys.stdin = original_stdin
|
||||||
sys.stdout = original_stdout
|
sys.stdout = original_stdout
|
||||||
sys.stderr = original_stderr
|
sys.stderr = original_stderr
|
||||||
|
# For Django 1.4.x, convert sys.exit(1) and stderr message to the
|
||||||
|
# CommandError(msg) exception used by Django 1.5 and later.
|
||||||
|
if isinstance(result, SystemExit) and captured_stderr:
|
||||||
|
result = CommandError(captured_stderr)
|
||||||
return result, captured_stdout, captured_stderr
|
return result, captured_stdout, captured_stderr
|
||||||
|
|
||||||
class CleanupDeletedTest(BaseCommandTest):
|
class CleanupDeletedTest(BaseCommandTest):
|
||||||
|
|||||||
Reference in New Issue
Block a user