  
  class WithTagTests(SimpleTestCase):
  
      @setup({'with01': '{% with key=dict.key %}{{ key }}{% endwith %}'})
      def test_with01(self):
          output = self.engine.render_to_string('with01', {'dict': {'key': 50}})
 
</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, self.at_least_with_one_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             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"'):
    at_least_with_one_msg = "'with' expected at least one variable assignment"
  
  class WithTagTests(SimpleTestCase):
    at_least_with_one_msg = "'with' expected at least one variable assignment"
  
      @setup({'with01': '{% with key=dict.key %}{{ key }}{% endwith %}'})
      def test_with01(self):
          output = self.engine.render_to_string('with01', {'dict': {'key': 50}})
keep add keep keep keep keep
 Used assertRaisesMessage() to test Django's error messages. 
tests/template_tests/syntax_tests/test_with.py