          )
  
          # Variables should reject access of attributes beginning with
          # underscores.
          self.assertRaises(TemplateSyntaxError, Variable, "article._hidden")
  
          # Variables should raise on non string type
          with six.assertRaisesRegex(self, TypeError, "Variable must be a string or number, got <(class|type) 'dict'>"):
              Variable({})
  
 
</s> remove         self.assertRaises(TemplateSyntaxError, FilterExpression, "article._hidden|upper", p)
 </s> add         with self.assertRaises(TemplateSyntaxError):
            FilterExpression("article._hidden|upper", p) </s> remove             self.assertRaises(TypeError, lm.save, fid_range=bad)
 </s> add             with self.assertRaises(TypeError):
                lm.save(fid_range=bad) </s> remove             self.assertRaises(GEOSException, fg._get_ptr)
 </s> add             with self.assertRaises(GEOSException):
                fg._get_ptr() </s> remove         self.assertRaises(Site.DoesNotExist, Site.objects.get_current)
 </s> add         with self.assertRaises(Site.DoesNotExist):
            Site.objects.get_current() </s> remove             self.assertRaises(LayerMapError, LayerMapping, County, co_shp, co_mapping)
 </s> add             with self.assertRaises(LayerMapError):
                LayerMapping(County, co_shp, co_mapping)
        with self.assertRaises(TemplateSyntaxError):
            Variable("article._hidden")
          )
  
          # Variables should reject access of attributes beginning with
          # underscores.
        with self.assertRaises(TemplateSyntaxError):
            Variable("article._hidden")
  
          # Variables should raise on non string type
          with six.assertRaisesRegex(self, TypeError, "Variable must be a string or number, got <(class|type) 'dict'>"):
              Variable({})
  
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