Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NarenderRajuB committed Oct 9, 2024
1 parent 59f686d commit 9124f7a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/export_config/helpers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os

from datetime import date
import jsonschema
from flask import current_app
from jsonschema import validate
Expand All @@ -25,7 +25,7 @@ def write_config(config, filename, round_short_name, config_type):
config_dict = convert_to_dict(config) # Convert config to dict for non-JSON types
content_to_write = "LOADER_CONFIG="
content_to_write += str(config_dict)
file_path = os.path.join(output_dir, f"{human_to_snake_case(filename)}.py")
file_path = os.path.join(output_dir, f"{human_to_snake_case(filename)}_{date.today().strftime('%d-%m-%Y')}.py")
elif config_type == "html":
output_dir = os.path.join(base_output_dir, "html/")
content_to_write = config
Expand Down
2 changes: 1 addition & 1 deletion tests/test_config_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_generate_config_for_round_valid_input(seed_dynamic_data, _db, filename)
expected_page_count_for_form = 8
expected_component_count_for_form = 27
# check form config is in the database
forms = _db.session.query(Form).filter(Form.template_name == filename)
forms = _db.session.query(Form).filter(Form.template_name == filename.split('.')[0])
assert forms.count() == expected_form_count
form = forms.first()
pages = _db.session.query(Page).filter(Page.form_id == form.form_id)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def test_generate_config_for_round_valid_input(

expected_form_count = 1
# check form config is in the database
forms = _db.session.query(Form).filter(Form.template_name == filename)
forms = _db.session.query(Form).filter(Form.template_name == filename.split('.')[0])
assert forms.count() == expected_form_count
form = forms.first()
pages = _db.session.query(Page).filter(Page.form_id == form.form_id)
Expand Down

0 comments on commit 9124f7a

Please sign in to comment.