          self.assertEqual(fe.var, 'Some "Good" News')
  
          # Filtered variables should reject access of attributes beginning with
          # underscores.
          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")
          self.assertEqual(Variable('"News"').resolve(c), "News")
 
</s> remove         self.assertRaises(TemplateSyntaxError, Variable, "article._hidden")
 </s> add         with self.assertRaises(TemplateSyntaxError):
            Variable("article._hidden") </s> remove         self.assertRaises(ValueError, setattr, p, 'restaurant', p)
 </s> add         with self.assertRaises(ValueError):
            setattr(p, 'restaurant', p) </s> remove         self.assertRaises(ValueError, setattr, p, 'restaurant', None)
 </s> add         with self.assertRaises(ValueError):
            setattr(p, 'restaurant', None) </s> remove             self.assertRaises(ValueError, getattr, field, 'width')
            self.assertRaises(ValueError, getattr, field, 'height')
 </s> add             with self.assertRaises(ValueError):
                getattr(field, 'width')
            with self.assertRaises(ValueError):
                getattr(field, 'height') </s> remove         self.assertRaises(FieldError, test_gmbh.save)
 </s> add         with self.assertRaises(FieldError):
            test_gmbh.save()
        with self.assertRaises(TemplateSyntaxError):
            FilterExpression("article._hidden|upper", p)
          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")
          self.assertEqual(Variable('"News"').resolve(c), "News")
keep keep keep keep replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/template_tests/test_parser.py