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

Add tests for broken link actions #3096

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

Conversation

MizukiTemma
Copy link
Member

@MizukiTemma MizukiTemma commented Oct 2, 2024

Short description

This PR adds tests for actions users can take in the broken link list.

Proposed changes

  • Do each action and check whether the target URLs/links are changed as expected.
  • Check whether actions taken in the netowork management are affecting all the targets system-wide, while actions within a region changing on the objects that belong to the region.

Side effects

  • Two assersions are disabled, as they are failling somehow (new url/link objects are not created after action). So far as I observed, both search&replace and URL replace are working fine. Probably a special care is needed for the link check listener?

Resolved issues

Fixes: #3062


Pull Request Review Guidelines

Copy link

codeclimate bot commented Oct 2, 2024

Code Climate has analyzed commit a306330 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 82.9% (0.4% change).

View more on Code Climate.

Copy link
Member

@david-venhoff david-venhoff left a comment

Choose a reason for hiding this comment

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

Thanks, this looks mostly good to me :)

Could you also add a test case for #3058?

integreat_cms/cms/views/linkcheck/linkcheck_list_view.py Outdated Show resolved Hide resolved
tests/cms/views/link_replace/test_link_actions.py Outdated Show resolved Hide resolved
)

assert Link.objects.filter(url__url=OLD_URL).count() == after
# assert Link.objects.filter(url__url=NEW_URL).count() == before - after
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 commented out?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's failing somehow 😢

tests/cms/views/link_replace/test_link_actions.py Outdated Show resolved Hide resolved
@MizukiTemma MizukiTemma added not-testable Issues that are not testable and removed not-testable Issues that are not testable labels Dec 11, 2024
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 test for actions in the broken link list
2 participants