Capital costs are the costs of buying or leasing your asset and paying for refurbishment.
\n\n
Community Ownership Fund 2025 (COF25) will fund up to 80% of the total capital costs of your project, up to a maximum of £2 million.
\n\n
At least 20% of the total capital costs of your project must be covered by other sources (match funding). For example:
\n\n
\n
You want to purchase a community asset which costs £2,500,000. You can apply for £2m from COF25, and must raise the remaining £500,000 from other sources.
\n
You want to purchase a community asset which costs £250,000. You can apply for £200,000 from COF25, and must raise the remaining £50,000 from other sources.
\n
\n\n
(In exceptional circumstances, you may only need to secure 10% in match funding. Your development support provider will have already confirmed this with you if you’re eligible.)
\n\n
If successful, you must spend all the funding within 12 months.
Tell us about the total capital costs of your project.
\n\n
This should be for the whole project, not just what you're requesting from the fund.
\n\n
Capital costs can be used to:\n
\n
purchase or lease the asset
\n
pay for refurbishment costs
\n
\n
\n
Remember, you can apply for up to 80% (or 90% if the development support provider has confirmed you're eligible to do this) of your capital costs, up to a maximum of £2 million.
\n
You can use your business plan to provide information that supports your answers.
Tell us about the total capital costs of your project.
\n\n
This should be for the whole project, not just what you're requesting from the fund.
\n\n
Capital costs can be used to:\n
\n
purchase or lease the asset
\n
pay for refurbishment costs
\n
\n\n
Remember, you can apply for up to 80% (or 90% if the development support provider has confirmed you're eligible to do this) of your capital costs, up to a maximum of \u00a32 million.
\n
You can use your business plan to provide information that supports your answers.
\n\n\n\n",
+ "options": {},
+ "schema": {},
+ "name": "EaxCoo"
+ },
+ {
+ "options": {
+ "prefix": "\u00a3",
+ "columnTitles": [
+ "Description",
+ "Amount",
+ "Money from COF25 grant",
+ "Match funding amount",
+ "Action"
+ ],
+ "required": true
+ },
+ "type": "MultiInputField",
+ "title": "Capital costs",
+ "hint": "The MultiInputField needed",
+ "schema": {},
+ "name": "qQLyXL",
+ "children": [
+ {
+ "name": "GLQlOh",
+ "options": {},
+ "type": "TextField",
+ "title": "Describe the cost"
+ },
+ {
+ "name": "JtwkMy",
+ "options": {
+ "prefix": "\u00a3",
+ "classes": "govuk-!-width-one-half"
+ },
+ "type": "NumberField",
+ "title": "Amount",
+ "hint": "",
+ "schema": {}
+ },
+ {
+ "name": "LeTLDo",
+ "options": {
+ "prefix": "\u00a3",
+ "classes": "govuk-!-width-one-half"
+ },
+ "type": "NumberField",
+ "title": "How much money from the COF25 grant will you use to pay for this cost?",
+ "hint": "",
+ "schema": {}
+ },
+ {
+ "name": "pHZDWT",
+ "options": {
+ "prefix": "\u00a3",
+ "classes": "govuk-!-width-one-half"
+ },
+ "type": "NumberField",
+ "title": "How much of the match funding will you use to pay for this cost?",
+ "hint": "",
+ "schema": {}
+ }
+ ]
+ }
+ ],
+ "next": [
+ {
+ "path": "/summary"
+ }
+ ],
+ "controller": "RepeatingFieldPageController"
+ }
+ ],
+ "lists": [],
+ "conditions": [],
+ "sections": [],
+ "outputs": [],
+ "skipSummary": false,
+ "name": "Apply for funding to save an asset in your community"
+}
\ No newline at end of file
diff --git a/tests/test_data/multi_input.json b/tests/test_data/multi_input.json
new file mode 100644
index 0000000..bc87c02
--- /dev/null
+++ b/tests/test_data/multi_input.json
@@ -0,0 +1,283 @@
+{
+ "metadata": {},
+ "startPage": "/funding-required",
+
+ "pages": [
+ {
+ "title": "Funding required",
+ "path": "/funding-required",
+ "components": [
+ {
+ "name": "RgwAoN",
+ "options": {},
+ "type": "Para",
+ "content": "\n\n
Tell us about the total capital costs of your project.
\n\n
This should be for the whole project, not just what you're requesting from the fund.
\n\n
Capital costs can be used to:\n
\n
purchase or lease the asset
\n
pay for refurbishment costs
\n
\n\n
Remember, you can apply for up to 80% (or 90% if the development support provider has confirmed you're eligible to do this) of your capital costs, up to a maximum of £2 million.
\n
You can use your business plan to provide information that supports your answers.
\n\n\n\n"
+ },
+ {
+ "name": "qQLyXL",
+ "options": {
+ "prefix": "£",
+ "columnTitles": [
+ "Description",
+ "Amount",
+ "Money from COF25 grant",
+ "Match funding amount",
+ "Action"
+ ],
+ "required": true
+ },
+ "type": "MultiInputField",
+ "title": "Capital costs",
+ "hint": "The MultiInputField needed",
+ "schema": {},
+ "children": [
+ {
+ "name": "GLQlOh",
+ "options": {},
+ "type": "TextField",
+ "title": "Describe the cost"
+ },
+ {
+ "name": "JtwkMy",
+ "options": {
+ "prefix": "£",
+ "classes": "govuk-!-width-one-half"
+ },
+ "type": "NumberField",
+ "title": "Amount",
+ "hint": "",
+ "schema": {}
+ },
+ {
+ "name": "LeTLDo",
+ "options": {
+ "prefix": "£",
+ "classes": "govuk-!-width-one-half"
+ },
+ "type": "NumberField",
+ "title": "How much money from the COF25 grant will you use to pay for this cost?",
+ "hint": "",
+ "schema": {}
+ },
+ {
+ "name": "pHZDWT",
+ "options": {
+ "prefix": "£",
+ "classes": "govuk-!-width-one-half"
+ },
+ "type": "NumberField",
+ "title": "How much of the match funding will you use to pay for this cost?",
+ "hint": "",
+ "schema": {}
+ }
+ ]
+ }
+ ],
+ "next": [
+ {
+ "path": "/summary"
+ }
+ ],
+ "section": "bgUGuD"
+ }
+
+ ],
+ "lists": [],
+ "sections": [
+ {
+ "name": "bgUGuD",
+ "title": "Funding required"
+ }
+ ],
+ "conditions": [
+ {
+ "displayName": "Have you secured any match funding yet-yes",
+ "name": "QyNLbn",
+ "value": {
+ "name": "Have you secured any match funding yet-yes",
+ "conditions": [
+ {
+ "field": {
+ "name": "DOvZvB",
+ "type": "YesNoField",
+ "display": "Have you secured any match funding yet?"
+ },
+ "operator": "is",
+ "value": {
+ "type": "Value",
+ "value": "true",
+ "display": "true"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "displayName": "Have you secured any match funding yet-no",
+ "name": "nzrkpu",
+ "value": {
+ "name": "Have you secured any match funding yet-no",
+ "conditions": [
+ {
+ "field": {
+ "name": "DOvZvB",
+ "type": "YesNoField",
+ "display": "Have you secured any match funding yet?"
+ },
+ "operator": "is",
+ "value": {
+ "type": "Value",
+ "value": "false",
+ "display": "false"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "displayName": "Do you have any match funding identified but not yet secured-yes",
+ "name": "DrELrt",
+ "value": {
+ "name": "Do you have any match funding identified but not yet secured-yes",
+ "conditions": [
+ {
+ "field": {
+ "name": "DmgsiG",
+ "type": "YesNoField",
+ "display": "Do you have any match funding identified but not yet secured?"
+ },
+ "operator": "is",
+ "value": {
+ "type": "Value",
+ "value": "true",
+ "display": "true"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "displayName": "Do you have any match funding identified but not yet secured-no",
+ "name": "nPKnjf",
+ "value": {
+ "name": "Do you have any match funding identified but not yet secured-no",
+ "conditions": [
+ {
+ "field": {
+ "name": "DmgsiG",
+ "type": "YesNoField",
+ "display": "Do you have any match funding identified but not yet secured?"
+ },
+ "operator": "is",
+ "value": {
+ "type": "Value",
+ "value": "false",
+ "display": "false"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "displayName": "Are you applying for revenue funding from the Community Ownership Fund 2025-yes",
+ "name": "iegbPT",
+ "value": {
+ "name": "Are you applying for revenue funding from the Community Ownership Fund 2025-yes",
+ "conditions": [
+ {
+ "field": {
+ "name": "matkNH",
+ "type": "YesNoField",
+ "display": "Are you applying for revenue funding from the Community Ownership Fund 2025? (optional)"
+ },
+ "operator": "is",
+ "value": {
+ "type": "Value",
+ "value": "true",
+ "display": "true"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "displayName": "Are you applying for revenue funding from the Community Ownership Fund 2025-no",
+ "name": "zVdAqG",
+ "value": {
+ "name": "Are you applying for revenue funding from the Community Ownership Fund 2025-no",
+ "conditions": [
+ {
+ "field": {
+ "name": "matkNH",
+ "type": "YesNoField",
+ "display": "Are you applying for revenue funding from the Community Ownership Fund 2025? (optional)"
+ },
+ "operator": "is",
+ "value": {
+ "type": "Value",
+ "value": "false",
+ "display": "false"
+ }
+ }
+ ]
+ }
+ }
+ ],
+ "fees": [],
+ "outputs": [],
+ "version": 2,
+ "skipSummary": false,
+ "name": "Apply for funding to save an asset in your community",
+ "feedback": {
+ "feedbackForm": false,
+ "url": ""
+ },
+ "phaseBanner": {
+ "phase": "beta"
+ }
+}
diff --git a/tests/test-import-form.json b/tests/test_data/test-import-form.json
similarity index 100%
rename from tests/test-import-form.json
rename to tests/test_data/test-import-form.json
diff --git a/tests/test_generate_form.py b/tests/test_generate_form.py
index 5e00ed4..0e6c9a8 100644
--- a/tests/test_generate_form.py
+++ b/tests/test_generate_form.py
@@ -182,6 +182,17 @@ def test_build_page_controller_not_specified():
components=[],
)
),
+ (
+ Page(
+ page_id=uuid4(),
+ form_id=uuid4(),
+ display_path="page-with-options",
+ name_in_apply_json={"en": "Page with Options Name"},
+ form_index=1,
+ components=[],
+ options = {"first": "option"}
+ )
+ ),
],
)
def test_build_page(input_page):
@@ -190,6 +201,8 @@ def test_build_page(input_page):
assert result_page
assert mock_build_component.call_count == len(input_page.components)
assert len(result_page["components"]) == len(input_page.components)
+ if input_page.options:
+ assert result_page["options"] == input_page.options
id = uuid4()
@@ -311,6 +324,58 @@ def test_build_conditions(
"values": {"type": "listRef"},
},
),
+ (
+ Component(
+ component_id=uuid4(),
+ type=ComponentType.MULTI_INPUT_FIELD,
+ title="Test Title",
+ hint_text="This must be a hint",
+ page_id=None,
+ page_index=1,
+ theme_id=None,
+ runner_component_name="test-name",
+ options={},
+ lizt=None,
+ list_id=None,
+ children=[
+ {"name": "GLQlOh", "options": {}, "type": "TextField", "title": "Describe the cost"},
+ {
+ "name": "JtwkMy",
+ "options": {"prefix": "£", "classes": "govuk-!-width-one-half"},
+ "type": "NumberField",
+ "title": "Amount",
+ "hint": "",
+ "schema": {},
+ },
+ {
+ "name": "LeTLDo",
+ "options": {"prefix": "£", "classes": "govuk-!-width-one-half"},
+ "type": "NumberField",
+ "title": "How much money from the COF25 grant will you use to pay for this cost?",
+ "hint": "",
+ "schema": {},
+ },
+ {
+ "name": "pHZDWT",
+ "options": {"prefix": "£", "classes": "govuk-!-width-one-half"},
+ "type": "NumberField",
+ "title": "How much of the match funding will you use to pay for this cost?",
+ "hint": "",
+ "schema": {},
+ },
+ ],
+ ),
+ {
+ "name": "test-name",
+ "options": {},
+ "type": "MultiInputField",
+ "title": "Test Title",
+ "hint": "This must be a hint",
+ "schema": {},
+ "metadata": {},
+ "children":[{'name': 'GLQlOh', 'options': {}, 'type': 'TextField', 'title': 'Describe the cost'}, {'name': 'JtwkMy', 'options': {'prefix': '£', 'classes': 'govuk-!-width-one-half'}, 'type': 'NumberField', 'title': 'Amount', 'hint': '', 'schema': {}}, {'name': 'LeTLDo', 'options': {'prefix': '£', 'classes': 'govuk-!-width-one-half'}, 'type': 'NumberField', 'title': 'How much money from the COF25 grant will you use to pay for this cost?', 'hint': '', 'schema': {}}, {'name': 'pHZDWT', 'options': {'prefix': '£', 'classes': 'govuk-!-width-one-half'}, 'type': 'NumberField', 'title': 'How much of the match funding will you use to pay for this cost?', 'hint': '', 'schema': {}}]
+ },
+ ),
],
)
def test_build_component(component_to_build, exp_result):
diff --git a/tests/test_integration.py b/tests/test_integration.py
index d2576cb..d736468 100644
--- a/tests/test_integration.py
+++ b/tests/test_integration.py
@@ -284,8 +284,6 @@ def test_list_relationship(seed_dynamic_data):
assert result.lizt
assert result.lizt.name == "classifications_list"
-
-# add files in /test_data t orun the below test against each file
@pytest.mark.parametrize(
"input_filename, output_filename,,expected_page_count_for_form,expected_component_count_for_form",
[
@@ -293,8 +291,8 @@ def test_list_relationship(seed_dynamic_data):
("optional-all-components.json", "optional.json", 8, 27),
("required-all-components.json", "required.json", 8, 27),
("favourite-colours-sarah.json", "colours.json", 4, 1),
- # TODO see why this fails
- # ("Organisation-and-local-authority-information-template.json", "local-authority-and-other-organisation-information.json",16, 24), # noqa: E501
+ ("funding-required-cof-25.json", "funding-required.json", 12, 21),
+ ("Organisation-and-local-authority-information-template.json", "local-authority-and-other-organisation-information.json",16, 24), # noqa: E501
],
)
def test_generate_config_for_round_valid_input(