              response = self.client.get('/test_utils/no_template_used/')
              self.assertTemplateUsed(response, 'template_used/base.html')
  
      def test_failure(self):
          with self.assertRaises(TypeError):
              with self.assertTemplateUsed():
                  pass
  
          with self.assertRaises(AssertionError):
              with self.assertTemplateUsed(''):
 
</s> remove         with self.assertRaises(AssertionError):
 </s> add         msg = 'No templates used to render the response'
        with self.assertRaisesMessage(AssertionError, msg): </s> remove         with self.assertRaises(AssertionError):
 </s> add         with self.assertRaisesMessage(AssertionError, msg): </s> remove         with self.assertRaises(AssertionError):
 </s> add         with self.assertRaisesMessage(AssertionError, msg): </s> remove         with self.assertRaises(AssertionError):
 </s> add         msg = (
            'template_used/base.html was not rendered. Following '
            'templates were rendered: template_used/alternative.html'
        )
        with self.assertRaisesMessage(AssertionError, msg): </s> remove         with self.assertRaises(TypeError):
 </s> add         msg = 'Cannot call delete() after .values() or .values_list()'
        with self.assertRaisesMessage(TypeError, msg):
        msg = 'response and/or template_name argument must be provided'
        with self.assertRaisesMessage(TypeError, msg):
              response = self.client.get('/test_utils/no_template_used/')
              self.assertTemplateUsed(response, 'template_used/base.html')
  
      def test_failure(self):
        msg = 'response and/or template_name argument must be provided'
        with self.assertRaisesMessage(TypeError, msg):
              with self.assertTemplateUsed():
                  pass
  
          with self.assertRaises(AssertionError):
              with self.assertTemplateUsed(''):
keep keep keep keep replace keep keep keep keep keep
 Used assertRaisesMessage() to test Django's error messages. 
tests/test_utils/tests.py