Skip to content

Commit

Permalink
Merge PR #131 into 13.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Sep 3, 2021
2 parents 9bdae97 + c563bcd commit 6d322f2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
3 changes: 3 additions & 0 deletions dms/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ Preview
the other `mail_preview` modules from `social` OCA repository
in order to improve the preview of files.

`python-magic` library is recommended to be installed for having whole support
to get proper file types and file preview.

Configuration
=============

Expand Down
3 changes: 3 additions & 0 deletions dms/readme/INSTALL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ Preview
`mail_preview_base` is required for DMS but it is recommended to install all
the other `mail_preview` modules from `social` OCA repository
in order to improve the preview of files.

`python-magic` library is recommended to be installed for having whole support
to get proper file types and file preview.
4 changes: 3 additions & 1 deletion dms/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
<title>Document Management System</title>
<style type="text/css">

Expand Down Expand Up @@ -406,6 +406,8 @@ <h2><a class="toc-backref" href="#id2">Preview</a></h2>
<p><cite>mail_preview_base</cite> is required for DMS but it is recommended to install all
the other <cite>mail_preview</cite> modules from <cite>social</cite> OCA repository
in order to improve the preview of files.</p>
<p><cite>python-magic</cite> library is recommended to be installed for having whole support
to get proper file types and file preview.</p>
</div>
</div>
<div class="section" id="configuration">
Expand Down
12 changes: 12 additions & 0 deletions dms/tests/test_file.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# Copyright 2017-2019 MuK IT GmbH.
# Copyright 2020 Creu Blanca
# Copyright 2021 Tecnativa - Víctor Martínez
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

import base64

from .common import multi_users
from .test_file_database import FileTestCase

try:
import magic
except ImportError:
magic = None


class FileFilestoreTestCase(FileTestCase):
def _setup_test_data(self):
Expand Down Expand Up @@ -84,3 +90,9 @@ def test_content_file_res_mimetype(self):
self.assertEqual(file_svg.res_mimetype, "image/svg+xml")
file_logo = self.env.ref("dms.file_02_demo")
self.assertEqual(file_logo.res_mimetype, "image/jpeg")

def test_content_file_res_mimetype_magic_library(self):
if not magic:
self.skipTest("Without python-magic library installed")
file_video = self.env.ref("dms.file_10_demo")
self.assertEqual(file_video.res_mimetype, "video/mp4")

0 comments on commit 6d322f2

Please sign in to comment.