Skip to content

Commit

Permalink
fix non string for fund config export
Browse files Browse the repository at this point in the history
fix non string for fund config export

fix data class
  • Loading branch information
NarenderRajuB committed Feb 12, 2025
1 parent abf5083 commit 6d0d157
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
3 changes: 0 additions & 3 deletions app/export_config/generate_fund_round_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,6 @@ def generate_fund_config(round_id):
short_name=fund.short_name,
description_json=fund.description_json,
welsh_available=fund.welsh_available,
owner_organisation_name="None",
owner_organisation_shortname="None",
owner_organisation_logo_uri="None",
funding_type=fund.funding_type.value,
ggis_scheme_reference_number=fund.ggis_scheme_reference_number,
)
Expand Down
6 changes: 3 additions & 3 deletions app/shared/data_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ class FundExport:
id: str
short_name: dict
welsh_available: bool
owner_organisation_name: str
owner_organisation_shortname: str
owner_organisation_logo_uri: str
ggis_scheme_reference_number: str
funding_type: FundingType
owner_organisation_name: Optional[str] = None
owner_organisation_shortname: Optional[str] = None
owner_organisation_logo_uri: Optional[str] = None
name_json: NameJson = field(default_factory=NameJson)
title_json: TitleJson = field(default_factory=TitleJson)
description_json: DescriptionJson = field(default_factory=DescriptionJson)
Expand Down
10 changes: 5 additions & 5 deletions tests/test_config_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from pathlib import Path

import pytest
from bs4 import BeautifulSoup

from app.blueprints.application.routes import create_export_zip
from app.export_config.generate_fund_round_config import generate_config_for_round
Expand All @@ -17,7 +18,6 @@
generate_all_round_html,
)
from app.export_config.helpers import validate_json
from bs4 import BeautifulSoup


def read_data_from_output_file(file):
Expand Down Expand Up @@ -63,9 +63,9 @@ def test_generate_config_for_round_valid_input(seed_dynamic_data, monkeypatch, t
"fund_config": {
"short_name": fund_short_name,
"welsh_available": False,
"owner_organisation_name": "None",
"owner_organisation_shortname": "None",
"owner_organisation_logo_uri": "None",
"owner_organisation_name": None,
"owner_organisation_shortname": None,
"owner_organisation_logo_uri": None,
"name_json": {"en": "Unit Test Fund 1"},
"title_json": {"en": "funding to improve testing"},
"description_json": {"en": "A £10m fund to improve testing across the devolved nations."},
Expand Down Expand Up @@ -333,4 +333,4 @@ def test_create_export_zip(temp_output_dir):

def _normalize_html(html):
"""Parses and normalizes HTML using BeautifulSoup to avoid formatting differences."""
return BeautifulSoup(html, "html.parser").prettify()
return BeautifulSoup(html, "html.parser").prettify()

0 comments on commit 6d0d157

Please sign in to comment.