Don't show deprecation warning during tests for verbosity < 2

- Legacy-Id: 7205
This commit is contained in:
Henrik Levkowetz 2014-02-04 21:35:19 +00:00
parent 908aacceff
commit 35cadc1763

View file

@ -33,6 +33,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import socket, re, os, time, importlib
import warnings
from django.conf import settings
from django.template import TemplateDoesNotExist
@ -68,6 +69,8 @@ def safe_create_1(self, verbosity, *args, **kwargs):
module = importlib.import_module(".".join(components[:-1]))
fn = getattr(module, components[-1])
fn()
if verbosity < 2:
warnings.simplefilter("ignore", DeprecationWarning)
return test_database_name