Skip to content

Commit 10bd050

Browse files
fix linting and testing
1 parent 3ea879c commit 10bd050

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

condition-api/src/condition_api/services/project_service.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ def check_project_conditions(project_id, document_category_id):
103103
Document.project_id == project_id,
104104
DocumentCategory.id == document_category_id,
105105
Document.is_active.is_(True)
106-
)
107-
)
106+
))
108107
.all()
109108
)
110109

condition-api/tests/utilities/factory_utils.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,15 @@ def factory_auth_header(jwt, claims):
5656
def factory_project_model(
5757
project_id="58851056aaecd9001b80ebf8",
5858
project_name="Tulsequah Chief Mine",
59-
project_type="Mines"
59+
project_type="Mines",
60+
is_active=True
6061
):
6162
"""Factory for Project model."""
6263
project = Project(
6364
project_id=project_id,
6465
project_name=project_name,
65-
project_type=project_type
66+
project_type=project_type,
67+
is_active=is_active
6668
)
6769
db.session.add(project)
6870
db.session.commit()
@@ -89,7 +91,7 @@ def factory_document_type_model(category, name="Certificate"):
8991
return doc_type
9092

9193

92-
def factory_document_model(project_id, document_type_id, is_latest=True):
94+
def factory_document_model(project_id, document_type_id, is_latest=True, is_active=True):
9395
"""Document"""
9496
document = Document(
9597
document_id=str(uuid.uuid4()),
@@ -99,7 +101,8 @@ def factory_document_model(project_id, document_type_id, is_latest=True):
99101
document_file_name="test.pdf",
100102
is_latest_amendment_added=is_latest,
101103
date_issued=datetime.utcnow(),
102-
consultation_records_required=True
104+
consultation_records_required=True,
105+
is_active=is_active
103106
)
104107
db.session.add(document)
105108
db.session.commit()

0 commit comments

Comments
 (0)