-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow conversion of docx files to pdf using a new convert endpoint
- Loading branch information
1 parent
d2a3d12
commit 5cdf0d2
Showing
6 changed files
with
105 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import pytest | ||
from django.urls import reverse | ||
from rest_framework import status | ||
|
||
from document_merge_service.api.data import django_file | ||
|
||
|
||
# @pytest.mark.parametrize("template__description", ["test description"]) | ||
@pytest.mark.parametrize( | ||
"target_format,response_content_type", | ||
[ | ||
("pdf", "application/pdf"), | ||
], | ||
) | ||
def test_convert(db, client, template, target_format, response_content_type): | ||
url = reverse("convert") | ||
file_to_convert = django_file("docx-template-syntax.docx") | ||
|
||
data = {"file": file_to_convert.file, "target_format": target_format} | ||
response = client.post(url, data=data, format="multipart") | ||
|
||
assert response.status_code == status.HTTP_200_OK | ||
assert response.headers.get("Content-Type") == response_content_type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters