From 65c557115f6e76293c39ce7b73b62216911f9489 Mon Sep 17 00:00:00 2001 From: Senko Rasic Date: Sun, 19 May 2013 12:49:03 +0200 Subject: [PATCH] fix warnings imports in fixtures tests --- tests/fixtures_model_package/tests.py | 3 ++- tests/fixtures_regress/tests.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/fixtures_model_package/tests.py b/tests/fixtures_model_package/tests.py index af6b059c66..fbd0271336 100644 --- a/tests/fixtures_model_package/tests.py +++ b/tests/fixtures_model_package/tests.py @@ -1,5 +1,7 @@ from __future__ import unicode_literals +import warnings + from django.core import management from django.db import transaction from django.test import TestCase, TransactionTestCase @@ -100,7 +102,6 @@ class FixtureTestCase(TestCase): ) # Load a fixture that doesn't exist - import warnings with warnings.catch_warnings(record=True): management.call_command("loaddata", "unknown.json", verbosity=0, commit=False) diff --git a/tests/fixtures_regress/tests.py b/tests/fixtures_regress/tests.py index 97ad6c326a..5114302267 100644 --- a/tests/fixtures_regress/tests.py +++ b/tests/fixtures_regress/tests.py @@ -4,6 +4,7 @@ from __future__ import absolute_import, unicode_literals import os import re +import warnings from django.core.serializers.base import DeserializationError from django.core import management @@ -441,7 +442,6 @@ class TestFixtures(TestCase): def test_loaddata_not_existant_fixture_file(self): stdout_output = StringIO() - import warnings with warnings.catch_warnings(record=True): management.call_command( 'loaddata',