Skip to content

Commit

Permalink
Fixed test failures introduced in refs #23861.
Browse files Browse the repository at this point in the history
  • Loading branch information
timgraham committed Jan 5, 2015
1 parent ce17b04 commit 789baf9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions tests/check_framework/test_model_field_deprecation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
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 = {}
Expand Down Expand Up @@ -43,7 +45,7 @@ class Model(models.Model):
])


class TestRemovedField(SimpleTestCase):
class TestRemovedField(IsolateModelsMixin, SimpleTestCase):
def test_default_details(self):
class MyField(models.Field):
system_check_removed_details = {}
Expand Down
5 changes: 3 additions & 2 deletions tests/check_framework/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,7 @@ def test_silenced_warning(self):
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)
Expand All @@ -302,6 +301,8 @@ def tearDown(self):
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']
Expand Down

0 comments on commit 789baf9

Please sign in to comment.