          self.assertEqual(fe.var, 'Some "Good" News')
  
          # Filtered variables should reject access of attributes beginning with
          # underscores.
          with self.assertRaises(TemplateSyntaxError):
              FilterExpression("article._hidden|upper", p)
  
      def test_variable_parsing(self):
          c = {"article": {"section": "News"}}
          self.assertEqual(Variable("article.section").resolve(c), "News")
 
</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(TemplateSyntaxError):
 </s> add         with self.assertRaisesMessage(TemplateSyntaxError, "Invalid filter: 'fil'"): </s> remove         with self.assertRaises(FieldError):
 </s> add         msg = 'Joined field references are not permitted in this query'
        with self.assertRaisesMessage(FieldError, msg): </s> remove         with self.assertRaises(TemplateSyntaxError):
 </s> add         msg = (
            "get_flatpages expects a syntax of get_flatpages "
            "['url_starts_with'] [for user] as context_name"
        )
        with self.assertRaisesMessage(TemplateSyntaxError, msg): </s> remove         with self.assertRaises(DatabaseError):
 </s> add         msg = 'Forced update did not affect any rows.'
        with self.assertRaisesMessage(DatabaseError, msg):
        msg = "Variables and attributes may not begin with underscores: 'article._hidden'"
        with self.assertRaisesMessage(TemplateSyntaxError, msg):
          self.assertEqual(fe.var, 'Some "Good" News')
  
          # Filtered 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):
              FilterExpression("article._hidden|upper", p)
  
      def test_variable_parsing(self):
          c = {"article": {"section": "News"}}
          self.assertEqual(Variable("article.section").resolve(c), "News")
keep keep keep keep replace keep keep keep keep keep
 Used assertRaisesMessage() to test Django's error messages. 
tests/template_tests/test_parser.py