add unittest for filemanager and fix utf-8 bug in upload_document view