Skip to content

Conversation

@MyPyDavid
Copy link
Member

@MyPyDavid MyPyDavid commented Apr 7, 2025

Description

Follow up on PR #1301 with an e2e test for the filters in management and some refactoring

Motivation and Context

How has this been tested?

Screenshots (if appropriate)

Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
@MyPyDavid MyPyDavid self-assigned this Apr 7, 2025
@MyPyDavid MyPyDavid changed the base branch from main to 2.3.0-fix-local-storage April 7, 2025 16:48
@MyPyDavid MyPyDavid requested a review from jochenklar April 7, 2025 16:49
@MyPyDavid MyPyDavid added this to the RDMO 2.3.0 milestone Apr 7, 2025
"""pytest-playwright needs this setting to be enabled."""
os.environ.setdefault("DJANGO_ALLOW_ASYNC_UNSAFE", "true")

@pytest.fixture
Copy link
Member

Choose a reason for hiding this comment

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

I think settings.MULTISITE = True is exactly as verbose as needed. Please remove this fixture. (Unless there is a reason I don't see, here.)

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, I put it like that so that I could enable it only for that specific test under management but now the e2e page gets the multisite already, so then all the e2e tests are using it..
Otherwise I need to all of the setup of the page and login as well directly in the test..

Copy link
Member

Choose a reason for hiding this comment

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

ok, so all e2e tests are multisite? fine with me.

Copy link
Member Author

Choose a reason for hiding this comment

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

the e2e test packages have their own conftest.py, now I've enabled it there only for the management app

Copy link
Member Author

Choose a reason for hiding this comment

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

could also add another fixture page_multisite , to keep it separate

def test_import_and_update_optionsets_in_management(page: Page) -> None:
def test_import_and_update_optionsets_in_management(db, delete_option_objects, page: Page) -> None:
"""Test that each content type is available through the navigation."""
delete_all_objects([OptionSet, Option])
Copy link
Member

Choose a reason for hiding this comment

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

Why is this not just OptionSet.objects.delete() and Option.objects.delete()?

Copy link
Member

Choose a reason for hiding this comment

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

maybe a fixture, but still delete_all_objects([OptionSet, Option]) or better delete_all(OptionSet, Option) (using *args in the fixture).

Base automatically changed from 2.3.0-fix-local-storage to 2.3.0 April 8, 2025 08:31
Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
Signed-off-by: David Wallace <david.wallace@tu-darmstadt.de>
@MyPyDavid MyPyDavid merged commit 3a86a0b into 2.3.0 Apr 8, 2025
19 checks passed
@MyPyDavid MyPyDavid deleted the 2.3.0-fix-local-storage+e2e-tests branch April 8, 2025 14:55
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.

3 participants