Skip to content

Commit

Permalink
test: fix create project generate_appuser_files usage
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Feb 12, 2024
1 parent 90fa0d5 commit ea4ecad
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/backend/tests/test_projects_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import json
import os
import uuid
from io import BytesIO
from unittest.mock import Mock, patch

import pytest
Expand Down Expand Up @@ -203,6 +204,8 @@ async def test_generate_appuser_files(db, project):

# Provide custom xlsform file path
xlsform_file = f"{test_data_path}/buildings.xls"
with open(xlsform_file, "rb") as xlsform_data:
xlsform_obj = BytesIO(xlsform_data.read())

for task_id in task_ids:
# NOTE avoid the lambda function for run_in_threadpool
Expand All @@ -226,12 +229,13 @@ async def test_generate_appuser_files(db, project):
lambda: project_crud.generate_appuser_files(
db,
project_id,
custom_xls_form=xlsform_file,
category="buildings",
form_type="example_form_type",
custom_form=xlsform_obj,
form_category="buildings",
form_format="example_form_type",
background_task_id=uuid.uuid4(),
)
)

assert result is None


Expand Down

0 comments on commit ea4ecad

Please sign in to comment.