Skip to content

test_get_cre_csv and test_import_from_cre_csv always return 404 because ENABLE_MYOPENCRE is never set in tests #871

@shiwani42

Description

@shiwani42

What is the issue?

ENABLE_MYOPENCRE is imported as a plain boolean at module load time in web_main.py. Both /rest/v1/cre_csv and /rest/v1/cre_csv_import abort with 404 when it is False. The tests never patch this value, so both routes are permanently unreachable in the test environment and the CSV functionality has no test coverage.

Expected Behaviour

Both tests should reach the route handlers and validate the CSV functionality.

Actual Behaviour

AssertionError: 200 != 404 for both test_get_cre_csv and test_import_from_cre_csv.

Steps to reproduce

  1. Run the test suite: flask test
  2. Observe the failures on test_get_cre_csv and test_import_from_cre_csv in web_main_test.py

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions