1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-04-27 02:51:00 +00:00

remove office convert test

This commit is contained in:
lian 2025-03-24 14:34:47 +08:00
parent 213927e1a7
commit 7b60cc38aa
3 changed files with 0 additions and 67 deletions

View File

@ -128,16 +128,6 @@ class CanEditFileTest(BaseTestCase):
assert not self.can_edit_in_encrypted_repo_normal_size(file_name)
assert not self.can_edit_in_encrypted_repo_exceeded_size(file_name)
@patch('seahub.views.file.HAS_OFFICE_CONVERTER', True)
def test_doc_has_office_converter(self):
file_name = '123.doc'
assert not self.can_edit_in_normal_repo_normal_size(file_name)
assert not self.can_edit_in_normal_repo_exceeded_size(file_name)
assert not self.can_edit_in_encrypted_repo_normal_size(file_name)
assert not self.can_edit_in_encrypted_repo_exceeded_size(file_name)
@patch('seahub.views.file.ENABLE_ONLYOFFICE', True)
@patch('seahub.views.file.ONLYOFFICE_FILE_EXTENSION',
ONLYOFFICE_FILE_EXTENSION)
@ -176,16 +166,6 @@ class CanEditFileTest(BaseTestCase):
assert not self.can_edit_in_encrypted_repo_normal_size(file_name)
assert not self.can_edit_in_encrypted_repo_exceeded_size(file_name)
@patch('seahub.views.file.HAS_OFFICE_CONVERTER', True)
def test_docx_has_office_converter(self):
file_name = '123.docx'
assert not self.can_edit_in_normal_repo_normal_size(file_name)
assert not self.can_edit_in_normal_repo_exceeded_size(file_name)
assert not self.can_edit_in_encrypted_repo_normal_size(file_name)
assert not self.can_edit_in_encrypted_repo_exceeded_size(file_name)
@patch('seahub.views.file.ENABLE_ONLYOFFICE', True)
@patch('seahub.views.file.ONLYOFFICE_FILE_EXTENSION',
ONLYOFFICE_FILE_EXTENSION)

View File

@ -125,16 +125,6 @@ class CanPreviewFileTest(BaseTestCase):
assert not self.can_preview_in_encrypted_repo_normal_size(file_name)
assert not self.can_preview_in_encrypted_repo_exceeded_size(file_name)
@patch('seahub.views.file.HAS_OFFICE_CONVERTER', True)
def test_doc_has_office_converter(self):
file_name = '123.doc'
assert self.can_preview_in_normal_repo_normal_size(file_name)
assert not self.can_preview_in_normal_repo_exceeded_size(file_name)
assert not self.can_preview_in_encrypted_repo_normal_size(file_name)
assert not self.can_preview_in_encrypted_repo_exceeded_size(file_name)
@patch('seahub.views.file.ENABLE_ONLYOFFICE', True)
@patch('seahub.views.file.ONLYOFFICE_FILE_EXTENSION',
ONLYOFFICE_FILE_EXTENSION)
@ -168,16 +158,6 @@ class CanPreviewFileTest(BaseTestCase):
assert not self.can_preview_in_encrypted_repo_normal_size(file_name)
assert not self.can_preview_in_encrypted_repo_exceeded_size(file_name)
@patch('seahub.views.file.HAS_OFFICE_CONVERTER', True)
def test_docx_has_office_converter(self):
file_name = '123.docx'
assert self.can_preview_in_normal_repo_normal_size(file_name)
assert not self.can_preview_in_normal_repo_exceeded_size(file_name)
assert not self.can_preview_in_encrypted_repo_normal_size(file_name)
assert not self.can_preview_in_encrypted_repo_exceeded_size(file_name)
@patch('seahub.views.file.ENABLE_ONLYOFFICE', True)
@patch('seahub.views.file.ONLYOFFICE_FILE_EXTENSION',
ONLYOFFICE_FILE_EXTENSION)

View File

@ -94,33 +94,6 @@ class ViewLibFileTest(BaseTestCase):
self.assertEqual(200, resp.status_code)
self.assertTemplateUsed(resp, 'document_file_view_react.html')
# @patch('seahub.views.file.HAS_OFFICE_CONVERTER', True)
# @patch('seahub.views.file.can_preview_file')
# @patch('seahub.views.file.prepare_converted_html', create=True)
# def test_ms_doc_with_office_converter(self, mock_prepare_converted_html,
# mock_can_preview_file):
# mock_prepare_converted_html.return_value = None
# mock_can_preview_file.return_value = (True, None)
# self.login_as(self.user)
# file_path = self.create_file(repo_id=self.repo.id, parent_dir='/',
# filename="foo.doc", username=self.user.email)
# url = reverse('view_lib_file', args=[self.repo.id, file_path])
# resp = self.client.get(url)
# self.assertEqual(200, resp.status_code)
# self.assertTemplateUsed(resp, 'view_file_document.html')
# assert resp.context['filetype'].lower() == 'document'
# assert resp.context['err'] == ''
# # token for doc file is one time only
# raw_path = resp.context['raw_path']
# r = requests.get(raw_path)
# self.assertEqual(200, r.status_code)
# r = requests.get(raw_path)
# self.assertEqual(400, r.status_code)
def test_pdf_file(self):
self.login_as(self.user)