-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fs-4749 adding funding_type to exports
- Loading branch information
Showing
9 changed files
with
36 additions
and
125 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
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 |
---|---|---|
@@ -1,15 +1,7 @@ | ||
from datetime import datetime | ||
from uuid import uuid4 | ||
|
||
from sqlalchemy import select | ||
|
||
from app.db import db | ||
from app.db.models import Fund | ||
from app.db.models import Organisation | ||
from app.db.models import Round | ||
from app.db.queries.fund import add_fund | ||
from app.db.queries.fund import add_organisation | ||
from app.db.queries.round import add_round | ||
|
||
|
||
def get_round_by_title(title: str) -> Round: | ||
|
@@ -32,89 +24,6 @@ def get_round_by_title(title: str) -> Round: | |
return round | ||
|
||
|
||
def create_test_organisation(flask_test_client): | ||
""" | ||
Creates a test Organisation and persists it to the database. | ||
Args: | ||
flask_test_client: The test client to use for the request | ||
Returns: | ||
The Organisation object created | ||
""" | ||
return add_organisation( | ||
Organisation( | ||
name=f"test_org_{uuid4().hex[:8]}", | ||
short_name=f"X{uuid4().hex[:8]}", | ||
logo_uri="http://www.example.com", | ||
funds=[], | ||
) | ||
) | ||
|
||
|
||
def create_test_fund(flask_test_client, organisation): | ||
""" | ||
Creates a test Fund and persists it to the database. | ||
Args: | ||
flask_test_client: The test client to use for the request | ||
organisation: The Organisation object to use as the owner of the fund | ||
Returns: | ||
The Fund object created | ||
""" | ||
return add_fund( | ||
Fund( | ||
name_json={"en": "Test Fund"}, | ||
title_json={"en": "Test Fund Title"}, | ||
description_json={"en": "Test Fund Description"}, | ||
welsh_available=False, | ||
short_name=f"F{uuid4().hex[:8]}", | ||
owner_organisation_id=organisation.organisation_id, | ||
) | ||
) | ||
|
||
|
||
def create_test_round(flask_test_client, fund): | ||
""" | ||
Creates a test Round and persists it to the database. | ||
Args: | ||
flask_test_client: The test client to use for the request | ||
fund: The Fund object to use as the owner of the round | ||
Returns: | ||
The Round object created | ||
""" | ||
return add_round( | ||
Round( | ||
fund_id=fund.fund_id, | ||
title_json={"en": "Test Round"}, | ||
short_name=f"R{uuid4().hex[:8]}", | ||
opens=datetime.now().strftime("%m-%d-%Y %H:%M"), | ||
deadline=datetime.now().strftime("%m-%d-%Y %H:%M"), | ||
assessment_start=datetime.now().strftime("%m-%d-%Y %H:%M"), | ||
reminder_date=datetime.now().strftime("%m-%d-%Y %H:%M"), | ||
assessment_deadline=datetime.now().strftime("%m-%d-%Y %H:%M"), | ||
prospectus_link="http://www.example.com", | ||
privacy_notice_link="http://www.example.com", | ||
contact_email="[email protected]", | ||
contact_phone="1234567890", | ||
contact_textphone="0987654321", | ||
support_times="9am - 5pm", | ||
support_days="Monday to Friday", | ||
feedback_link="http://example.com/feedback", | ||
project_name_field_id=1, | ||
guidance_url="http://example.com/guidance", | ||
eligibility_config={"has_eligibility": "false"}, | ||
eoi_decision_schema={"en": "eoi_decision_schema", "cy": ""}, | ||
contact_us_banner_json={"en": "contact_us_banner", "cy": ""}, | ||
instructions_json={"en": "instructions", "cy": ""}, | ||
application_guidance_json={"en": "application_guidance", "cy": ""}, | ||
) | ||
) | ||
|
||
|
||
def get_csrf_token(response): | ||
""" | ||
Extracts the CSRF token from the given response. | ||
|
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