mirror of
https://github.com/suitenumerique/docs.git
synced 2026-10-01 14:05:12 +02:00
🔧(backend) settings CONVERSION_UPLOAD_ENABLED to control docspec usage
We want to control the conversion of document at upload time. We want to disable this feature using a settings. The new settings CONVERSION_UPLOAD_ENABLED should be used to enable or not the conversion at upload feature. If disabled and a file is uploaded, the reponse will return a 400
This commit is contained in:
@@ -261,7 +261,7 @@ def test_external_api_documents_create_subdocument_reader_not_allowed(
|
||||
|
||||
@patch("core.services.converter_services.Converter.convert")
|
||||
def test_external_api_documents_create_with_markdown_file_success(
|
||||
mock_convert, user_token, resource_server_backend, user_specific_sub
|
||||
mock_convert, user_token, resource_server_backend, user_specific_sub, settings
|
||||
):
|
||||
"""
|
||||
Users with an access token should be able to create documents through the resource
|
||||
@@ -272,6 +272,8 @@ def test_external_api_documents_create_with_markdown_file_success(
|
||||
client = APIClient()
|
||||
client.credentials(HTTP_AUTHORIZATION=f"Bearer {user_token}")
|
||||
|
||||
settings.CONVERSION_UPLOAD_ENABLED = True
|
||||
|
||||
# Mock the conversion
|
||||
converted_yjs = "base64encodedyjscontent"
|
||||
mock_convert.return_value = converted_yjs
|
||||
|
||||
Reference in New Issue
Block a user