[1.8.x] Silenced deprecation warning in refs #24287 test.

This commit is contained in:
Tim Graham 2015-02-09 12:34:23 -05:00
parent 9744529c12
commit eb406aa686
1 changed files with 7 additions and 4 deletions

View File

@ -2,14 +2,16 @@ from __future__ import unicode_literals
import os import os
import sys import sys
import warnings
from django.apps import apps from django.apps import apps
from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ImproperlyConfigured
from django.db import models from django.db import models
from django.test import TestCase from django.test import TestCase
from django.test.utils import extend_sys_path from django.test.utils import extend_sys_path
from django.utils._os import upath
from django.utils import six from django.utils import six
from django.utils._os import upath
from django.utils.deprecation import RemovedInDjango19Warning
class EggLoadingTest(TestCase): class EggLoadingTest(TestCase):
@ -98,6 +100,7 @@ class GetModelsTest(TestCase):
'Ensure that its module, "models_that_do_not_live_in_an_app", ' 'Ensure that its module, "models_that_do_not_live_in_an_app", '
'is located inside an installed app.' 'is located inside an installed app.'
) )
with warnings.catch_warnings():
with self.assertRaisesMessage(ImproperlyConfigured, msg): warnings.filterwarnings('ignore', category=RemovedInDjango19Warning)
declare_model_outside_app() with self.assertRaisesMessage(ImproperlyConfigured, msg):
declare_model_outside_app()