From 789baf9c3a432297ff775aee7f174494e4fd9962 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Mon, 5 Jan 2015 14:15:14 -0500 Subject: [PATCH] Fixed test failures introduced in refs #23861. --- tests/check_framework/test_model_field_deprecation.py | 6 ++++-- tests/check_framework/tests.py | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/check_framework/test_model_field_deprecation.py b/tests/check_framework/test_model_field_deprecation.py index 1bb8344749..a8a987b4cb 100644 --- a/tests/check_framework/test_model_field_deprecation.py +++ b/tests/check_framework/test_model_field_deprecation.py @@ -2,8 +2,10 @@ from django.db import models from django.core import checks from django.test import SimpleTestCase +from .tests import IsolateModelsMixin -class TestDeprecatedField(SimpleTestCase): + +class TestDeprecatedField(IsolateModelsMixin, SimpleTestCase): def test_default_details(self): class MyField(models.Field): system_check_deprecated_details = {} @@ -43,7 +45,7 @@ class TestDeprecatedField(SimpleTestCase): ]) -class TestRemovedField(SimpleTestCase): +class TestRemovedField(IsolateModelsMixin, SimpleTestCase): def test_default_details(self): class MyField(models.Field): system_check_removed_details = {} diff --git a/tests/check_framework/tests.py b/tests/check_framework/tests.py index a6f086aa86..ea4a8766bf 100644 --- a/tests/check_framework/tests.py +++ b/tests/check_framework/tests.py @@ -291,8 +291,7 @@ class SilencingCheckTests(TestCase): self.assertEqual(err.getvalue(), '') -class CheckFrameworkReservedNamesTests(TestCase): - +class IsolateModelsMixin(object): def setUp(self): self.current_models = apps.all_models[__package__] self.saved_models = set(self.current_models) @@ -302,6 +301,8 @@ class CheckFrameworkReservedNamesTests(TestCase): del self.current_models[model] apps.clear_cache() + +class CheckFrameworkReservedNamesTests(IsolateModelsMixin, TestCase): @override_settings( SILENCED_SYSTEM_CHECKS=['models.E20', 'fields.W342'], # ForeignKey(unique=True) INSTALLED_APPS=['django.contrib.auth', 'django.contrib.contenttypes', 'check_framework']