mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Used assertRaisesMessage() to test Django's error messages.
This commit is contained in:
@@ -179,7 +179,8 @@ class CheckCommandTests(SimpleTestCase):
|
||||
|
||||
@override_system_checks([simple_system_check, tagged_system_check])
|
||||
def test_invalid_tag(self):
|
||||
with self.assertRaises(CommandError):
|
||||
msg = 'There is no system check with the "missingtag" tag.'
|
||||
with self.assertRaisesMessage(CommandError, msg):
|
||||
call_command('check', tags=['missingtag'])
|
||||
|
||||
@override_system_checks([simple_system_check])
|
||||
|
||||
Reference in New Issue
Block a user