              "'%s' not in '%s'" % (text, filepath),
          )
  
      def assertFileNotFound(self, filepath):
          self.assertRaises(IOError, self._get_file, filepath)
  
      def render_template(self, template, **kwargs):
          if isinstance(template, six.string_types):
              template = Template(template)
          return template.render(Context(kwargs)).strip()
 
</s> remove         self.assertRaises(exc, self.assertStaticRenders, path, result, **kwargs)
 </s> add         with self.assertRaises(exc):
            self.assertStaticRenders(path, result, **kwargs) </s> remove         self.assertRaises(TemplateDoesNotExist, self.client.get, '/render_no_template/')
 </s> add         with self.assertRaises(TemplateDoesNotExist):
            self.client.get('/render_no_template/') </s> remove             self.assertRaises(NotImplementedError, Country.objects.all().geojson, field_name='mpoly')
 </s> add             with self.assertRaises(NotImplementedError):
                Country.objects.all().geojson(field_name='mpoly') </s> remove         self.assertRaises(ImproperlyConfigured, self.client.get, '/template/no_template/')
 </s> add         with self.assertRaises(ImproperlyConfigured):
            self.client.get('/template/no_template/') </s> remove             self.assertRaises(IndexError, setfcn, ul, i)  # 'set index %d' % i)
            self.assertRaises(IndexError, getfcn, ul, i)  # 'get index %d' % i)
            self.assertRaises(IndexError, delfcn, ul, i)  # 'del index %d' % i)
 </s> add             with self.assertRaises(IndexError):  # 'set index %d' % i)
                setfcn(ul, i)
            with self.assertRaises(IndexError):  # 'get index %d' % i)
                getfcn(ul, i)
            with self.assertRaises(IndexError):  # 'del index %d' % i)
                delfcn(ul, i)
        with self.assertRaises(IOError):
            self._get_file(filepath)
              "'%s' not in '%s'" % (text, filepath),
          )
  
      def assertFileNotFound(self, filepath):
        with self.assertRaises(IOError):
            self._get_file(filepath)
  
      def render_template(self, template, **kwargs):
          if isinstance(template, six.string_types):
              template = Template(template)
          return template.render(Context(kwargs)).strip()
keep keep keep keep replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/staticfiles_tests/cases.py