              self.assertFalse(self.storage.exists('normal.file'))
  
              # Check that OSErrors aside from ENOENT are still raised.
              self.storage.save('error.file', ContentFile('delete with error'))
              self.assertRaises(OSError, self.storage.delete, 'error.file')
          finally:
              os.remove = real_remove
  
      def test_file_chunks_error(self):
          """
 
</s> remove             self.assertRaises(OSError,
                self.storage.save, 'error/test.file', ContentFile('not saved'))
 </s> add             with self.assertRaises(OSError):
                self.storage.save('error/test.file', ContentFile('not saved')) </s> remove         self.assertRaises(IntegrityError, a2.save)
 </s> add         with self.assertRaises(IntegrityError):
            a2.save() </s> remove         self.assertRaises(
            DatabaseError,
            lambda: list(Thing.objects.all()),
        )
 </s> add         with self.assertRaises(DatabaseError):
            list(Thing.objects.all()) </s> remove             self.assertRaises(School.DoesNotExist, lambda: private_director.school)
 </s> add             with self.assertRaises(School.DoesNotExist):
                private_director.school </s> remove             self.assertRaises(ImportError, import_module, 'egg_module.no_such_module')
 </s> add             with self.assertRaises(ImportError):
                import_module('egg_module.no_such_module')
            with self.assertRaises(OSError):
                self.storage.delete('error.file')
              self.assertFalse(self.storage.exists('normal.file'))
  
              # Check that OSErrors aside from ENOENT are still raised.
              self.storage.save('error.file', ContentFile('delete with error'))
            with self.assertRaises(OSError):
                self.storage.delete('error.file')
          finally:
              os.remove = real_remove
  
      def test_file_chunks_error(self):
          """
keep keep keep keep replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/file_storage/tests.py