          self.assertEqual(output, 'AB')
  
      @setup({'with-error01': '{% with dict.key xx key %}{{ key }}{% endwith %}'})
      def test_with_error01(self):
          with self.assertRaises(TemplateSyntaxError):
              self.engine.render_to_string('with-error01', {'dict': {'key': 50}})
  
      @setup({'with-error02': '{% with dict.key as %}{{ key }}{% endwith %}'})
      def test_with_error02(self):
          with self.assertRaises(TemplateSyntaxError):
 
</s> remove         with self.assertRaises(TemplateSyntaxError):
 </s> add         with self.assertRaisesMessage(TemplateSyntaxError, self.at_least_with_one_msg): </s> remove             with self.assertRaises(TemplateSyntaxError):
 </s> add             with self.assertRaisesMessage(TemplateSyntaxError, msg): </s> remove             with self.assertRaises(TemplateSyntaxError):
 </s> add             msg = '"context" in %r tag expected exactly one argument.' % 'blocktrans'
            with self.assertRaisesMessage(TemplateSyntaxError, msg): </s> remove             with self.assertRaises(TemplateSyntaxError):
 </s> add             msg = "Unknown argument for 'blocktrans' tag: %r."
            with self.assertRaisesMessage(TemplateSyntaxError, msg % 'month="May"'):
        with self.assertRaisesMessage(TemplateSyntaxError, self.at_least_with_one_msg):
          self.assertEqual(output, 'AB')
  
      @setup({'with-error01': '{% with dict.key xx key %}{{ key }}{% endwith %}'})
      def test_with_error01(self):
        with self.assertRaisesMessage(TemplateSyntaxError, self.at_least_with_one_msg):
              self.engine.render_to_string('with-error01', {'dict': {'key': 50}})
  
      @setup({'with-error02': '{% with dict.key as %}{{ key }}{% endwith %}'})
      def test_with_error02(self):
          with self.assertRaises(TemplateSyntaxError):
keep keep keep keep replace keep keep keep keep keep
 Used assertRaisesMessage() to test Django's error messages. 
tests/template_tests/syntax_tests/test_with.py