Commit 577ced2a authored by Tim Graham's avatar Tim Graham
Browse files

Silenced OptionParser deprecation warning in a test.

parent 936fba58
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
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,6 +81,8 @@ class CommandTests(SimpleTestCase):
        optparse should be supported during Django 1.8/1.9 releases.
        """
        out = StringIO()
        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")