Skip to content

Test all usecases' asset forms - #517

Open
Bachibouzouk wants to merge 9 commits into
mainfrom
feature/test-all-usecases-asset-forms
Open

Test all usecases' asset forms#517
Bachibouzouk wants to merge 9 commits into
mainfrom
feature/test-all-usecases-asset-forms

Conversation

@Bachibouzouk

@Bachibouzouk Bachibouzouk commented Sep 8, 2026

Copy link
Copy Markdown

To run just this test:

python manage.py test projects.tests.ImportedUsecaseTest

or

python manage.py test --tag=integration_test

And to run all test without this one

python manage.py test --exclude-tag=integration_test

Comment thread app/projects/tests.py Outdated
asset_type=asset["asset_type"],
):
form_url = reverse(
"get_asset_create_form",

@paulapreuss paulapreuss Sep 8, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the case in which this test would fail would be if there is a field in the json usecase which doesn't match the form fields, triggering maybe a KeyError? I'm wondering if this wouldn't already cause project_upload to fail, as that also tries to load the Asset data into the database.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I refined the test so that if fails more specifically, it should also tell us if a project could not be uploaded.

Otherwise reverse() cannot be used with re_path
It downloads the usecase from open_plan and loads them into the test database
Then it collects all the assets' IDs and with them, call the endpoint to get
the form obtained when double clicking on the asset icon in the GUI.
@Bachibouzouk
Bachibouzouk force-pushed the feature/test-all-usecases-asset-forms branch from cfc6a16 to 47984cd Compare September 9, 2026 11:13
@Bachibouzouk
Bachibouzouk marked this pull request as ready for review September 9, 2026 11:13
Not limited to usecases projects
Endpoint needed the option to provide only 2 of the 3 arguments
This was just not nice to see in the test logs ^^
Comment thread app/fixtures/fixture.json

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this file wasn't used anywere

To be able to access the form when clicking on the asset in the GUI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants