          )
  
          # Variables should reject access of attributes beginning with
          # underscores.
          with self.assertRaises(TemplateSyntaxError):
              Variable("article._hidden")
  
          # Variables should raise on non string type
          with self.assertRaisesMessage(TypeError, "Variable must be a string or number, got <class 'dict'>"):
              Variable({})
 
</s> remove         with self.assertRaises(TemplateSyntaxError):
 </s> add         msg = "Variables and attributes may not begin with underscores: 'article._hidden'"
        with self.assertRaisesMessage(TemplateSyntaxError, msg): </s> remove             with self.assertRaises(transaction.TransactionManagementError):
 </s> add             msg = 'on_commit() cannot be used in manual transaction management'
            with self.assertRaisesMessage(transaction.TransactionManagementError, msg): </s> remove         # Should raise exception -- No redirect URL provided, and no
        # get_absolute_url provided
        with self.assertRaises(ImproperlyConfigured):
 </s> add         msg = (
            'No URL to redirect to.  Either provide a url or define a '
            'get_absolute_url method on the Model.'
        )
        with self.assertRaisesMessage(ImproperlyConfigured, msg): </s> remove         with self.assertRaises(TypeError):
 </s> add         msg = 'response and/or template_name argument must be provided'
        with self.assertRaisesMessage(TypeError, msg): </s> remove         with self.assertRaises(ImproperlyConfigured):
 </s> add         msg = (
            "TemplateResponseMixin requires either a definition of "
            "'template_name' or an implementation of 'get_template_names()'"
        )
        with self.assertRaisesMessage(ImproperlyConfigured, msg):
        msg = "Variables and attributes may not begin with underscores: 'article._hidden'"
        with self.assertRaisesMessage(TemplateSyntaxError, msg):
          )
  
          # Variables should reject access of attributes beginning with
          # underscores.
        msg = "Variables and attributes may not begin with underscores: 'article._hidden'"
        with self.assertRaisesMessage(TemplateSyntaxError, msg):
              Variable("article._hidden")
  
          # Variables should raise on non string type
          with self.assertRaisesMessage(TypeError, "Variable must be a string or number, got <class 'dict'>"):
              Variable({})
keep keep keep keep replace keep keep keep keep keep
 Used assertRaisesMessage() to test Django's error messages. 
tests/template_tests/test_parser.py