1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #31286 -- Made database specific fields checks databases aware.

Follow up to 0b83c8cc4d.
This commit is contained in:
Taoup
2020-02-19 19:14:54 +08:00
committed by Mariusz Felisiak
parent 94d4bd3a09
commit 271fdab8b7
4 changed files with 12 additions and 9 deletions

View File

@@ -27,7 +27,7 @@ class TestMultiDBChecks(SimpleTestCase):
model = Model()
with self._patch_check_field_on('default') as mock_check_field_default:
with self._patch_check_field_on('other') as mock_check_field_other:
model.check()
model.check(databases={'default', 'other'})
self.assertTrue(mock_check_field_default.called)
self.assertFalse(mock_check_field_other.called)
@@ -38,6 +38,6 @@ class TestMultiDBChecks(SimpleTestCase):
model = OtherModel()
with self._patch_check_field_on('other') as mock_check_field_other:
with self._patch_check_field_on('default') as mock_check_field_default:
model.check()
model.check(databases={'default', 'other'})
self.assertTrue(mock_check_field_other.called)
self.assertFalse(mock_check_field_default.called)