Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test for region deletion #3208

Merged
merged 1 commit into from
Dec 18, 2024
Merged

Conversation

JoeyStk
Copy link
Contributor

@JoeyStk JoeyStk commented Nov 14, 2024

Short description

This PR adds a test for region deletion

Proposed changes

  • Test to delete all regions
  • Test that all regions which are mirrored can't be deleted

Side effects

  • There might be some?

Resolved issues

Fixes: #3050


Pull Request Review Guidelines

@JoeyStk JoeyStk requested a review from MizukiTemma November 14, 2024 15:34
Copy link
Member

@MizukiTemma MizukiTemma left a comment

Choose a reason for hiding this comment

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

Thank you for adding test 💪 I have some suggestions, please find in the comments 💬

tests/cms/views/regions/delete_region.py Show resolved Hide resolved
tests/cms/views/regions/delete_region.py Outdated Show resolved Hide resolved
@david-venhoff
Copy link
Member

Do you remember when deleting a region caused internal server errors? Ideally we should catch these with the new tests

@JoeyStk
Copy link
Contributor Author

JoeyStk commented Nov 25, 2024

Do you remember when deleting a region caused internal server errors? Ideally we should catch these with the new tests

These are the three Issues/PRs that I could find:

I will add commits in the next days that also test for these use cases :)

@JoeyStk JoeyStk added the help wanted Extra attention is needed label Dec 14, 2024
@JoeyStk
Copy link
Contributor Author

JoeyStk commented Dec 14, 2024

As I'm busy with a lot of other issues/projects please feel free to contribute to this PR. I don't see myself going back to this PR anytime soon :(

@MizukiTemma MizukiTemma force-pushed the feature/add-test-for-region-deletion branch 2 times, most recently from afd9573 to 711175d Compare December 16, 2024 13:49
@MizukiTemma
Copy link
Member

I'll take over then this PR.

Changes and checks so far sugegsted are now applied.

@MizukiTemma MizukiTemma removed the help wanted Extra attention is needed label Dec 16, 2024
@MizukiTemma MizukiTemma force-pushed the feature/add-test-for-region-deletion branch from d27409e to 2afa96c Compare December 16, 2024 13:53
Copy link
Contributor

@jarlhengstmengel jarlhengstmengel left a comment

Choose a reason for hiding this comment

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

Thanks! Looks good to me :)

redirect = response.headers.get("location")
response = client.get(redirect)
assert (
"Die Region konnte nicht gelöscht werden, weil die folgenden Seiten in anderen Region gespiegelt werden:"
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a typo here with "Region" instead "Regionen", but it's also in the translation file so I think it's probably just copied from there?

Copy link
Member

@MizukiTemma MizukiTemma Dec 18, 2024

Choose a reason for hiding this comment

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

Hmm, I think singular is correct here, as delete_region handles actually one single region 👀

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"Die Region konnte nicht gelöscht werden, weil die folgenden Seiten in anderen Region gespiegelt werden:"
"Die Region konnte nicht gelöscht werden, weil die folgenden Seiten in anderen Regionen gespiegelt werden:"

I think @jarlhengstmengel was referring to the second occurrence, which should actually be plural.

Copy link
Member

Choose a reason for hiding this comment

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

@jarlhengstmengel @david-venhoff
Ah 🙈 Yes, it must be "Regionen" there. #3302

Co-authored-by: MizukiTemma <[email protected]>
@MizukiTemma MizukiTemma force-pushed the feature/add-test-for-region-deletion branch from 2afa96c to 571af55 Compare December 18, 2024 12:56
@MizukiTemma MizukiTemma merged commit 8ea1eed into develop Dec 18, 2024
5 checks passed
@MizukiTemma MizukiTemma deleted the feature/add-test-for-region-deletion branch December 18, 2024 13:07
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.

Add tests for region deletion
4 participants