Kaydet (Commit) 65c55711 authored tarafından Senko Rasic's avatar Senko Rasic

fix warnings imports in fixtures tests

üst c44a2c40
from __future__ import unicode_literals from __future__ import unicode_literals
import warnings
from django.core import management from django.core import management
from django.db import transaction from django.db import transaction
from django.test import TestCase, TransactionTestCase from django.test import TestCase, TransactionTestCase
...@@ -100,7 +102,6 @@ class FixtureTestCase(TestCase): ...@@ -100,7 +102,6 @@ class FixtureTestCase(TestCase):
) )
# Load a fixture that doesn't exist # Load a fixture that doesn't exist
import warnings
with warnings.catch_warnings(record=True): with warnings.catch_warnings(record=True):
management.call_command("loaddata", "unknown.json", verbosity=0, commit=False) management.call_command("loaddata", "unknown.json", verbosity=0, commit=False)
......
...@@ -4,6 +4,7 @@ from __future__ import absolute_import, unicode_literals ...@@ -4,6 +4,7 @@ from __future__ import absolute_import, unicode_literals
import os import os
import re import re
import warnings
from django.core.serializers.base import DeserializationError from django.core.serializers.base import DeserializationError
from django.core import management from django.core import management
...@@ -441,7 +442,6 @@ class TestFixtures(TestCase): ...@@ -441,7 +442,6 @@ class TestFixtures(TestCase):
def test_loaddata_not_existant_fixture_file(self): def test_loaddata_not_existant_fixture_file(self):
stdout_output = StringIO() stdout_output = StringIO()
import warnings
with warnings.catch_warnings(record=True): with warnings.catch_warnings(record=True):
management.call_command( management.call_command(
'loaddata', 'loaddata',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment