diff options
| author | Tim Graham <timograham@gmail.com> | 2014-07-24 08:51:47 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-07-24 08:51:47 -0400 |
| commit | 577ced2aae2136ed4e9dd9a75b2277373e2fa4a4 (patch) | |
| tree | 47c9358a79a9ab5d276dec649394c9127ade28ff /tests/user_commands | |
| parent | 936fba5878075576570ab7d2c84bfba80d183c18 (diff) | |
Silenced OptionParser deprecation warning in a test.
Diffstat (limited to 'tests/user_commands')
| -rw-r--r-- | tests/user_commands/tests.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/user_commands/tests.py b/tests/user_commands/tests.py index 43e19d1031..ac2e51c807 100644 --- a/tests/user_commands/tests.py +++ b/tests/user_commands/tests.py @@ -1,11 +1,13 @@ import os import sys +import warnings from django.core import management from django.core.management import CommandError from django.core.management.utils import find_command, popen_wrapper from django.test import SimpleTestCase from django.utils import translation +from django.utils.deprecation import RemovedInDjango20Warning from django.utils.six import StringIO @@ -79,7 +81,9 @@ class CommandTests(SimpleTestCase): optparse should be supported during Django 1.8/1.9 releases. """ out = StringIO() - management.call_command('optparse_cmd', stdout=out) + with warnings.catch_warnings(): + warnings.filterwarnings("ignore", category=RemovedInDjango20Warning) + management.call_command('optparse_cmd', stdout=out) self.assertEqual(out.getvalue(), "All right, let's dance Rock'n'Roll.\n") # Simulate command line execution |
