          self.assertEqual(tagged_system_check.kwargs, {'app_configs': None})
  
      @override_system_checks([simple_system_check, tagged_system_check])
      def test_invalid_tag(self):
          with self.assertRaises(CommandError):
              call_command('check', tags=['missingtag'])
  
      @override_system_checks([simple_system_check])
      def test_list_tags_empty(self):
          call_command('check', list_tags=True)
 
</s> remove         with self.assertRaises(CommandError):
 </s> add         msg = "Aborting password change for user 'joe' after 3 attempts"
        with self.assertRaisesMessage(CommandError, msg): </s> remove             with self.assertRaises(transaction.TransactionManagementError):
 </s> add             with self.assertRaisesMessage(transaction.TransactionManagementError, self.forbidden_atomic_msg): </s> remove             with self.assertRaises(transaction.TransactionManagementError):
 </s> add             with self.assertRaisesMessage(transaction.TransactionManagementError, self.forbidden_atomic_msg): </s> remove             with self.assertRaises(transaction.TransactionManagementError):
 </s> add             with self.assertRaisesMessage(transaction.TransactionManagementError, self.forbidden_atomic_msg): </s> remove             with self.assertRaises(NotImplementedError):
 </s> add             msg = 'Bilateral transformations on nested querysets are not supported.'
            with self.assertRaisesMessage(NotImplementedError, msg):
        msg = 'There is no system check with the "missingtag" tag.'
        with self.assertRaisesMessage(CommandError, msg):
          self.assertEqual(tagged_system_check.kwargs, {'app_configs': None})
  
      @override_system_checks([simple_system_check, tagged_system_check])
      def test_invalid_tag(self):
        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])
      def test_list_tags_empty(self):
          call_command('check', list_tags=True)
keep keep keep keep replace keep keep keep keep keep
 Used assertRaisesMessage() to test Django's error messages. 
tests/check_framework/tests.py