diff --git a/integreat_cms/cms/views/linkcheck/linkcheck_list_view.py b/integreat_cms/cms/views/linkcheck/linkcheck_list_view.py index b95b04abe0..64ce358628 100644 --- a/integreat_cms/cms/views/linkcheck/linkcheck_list_view.py +++ b/integreat_cms/cms/views/linkcheck/linkcheck_list_view.py @@ -222,7 +222,7 @@ def post(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse: messages.success(request, _("Links were successfully checked")) # Add short delay to allow rechecking to be finished when page reloads time.sleep(1) - + invalidate_model(Link) invalidate_model(Url) diff --git a/tests/cms/views/link_replace/test_link_actions.py b/tests/cms/views/link_replace/test_link_actions.py index bef17db70c..b8a60c1b0c 100644 --- a/tests/cms/views/link_replace/test_link_actions.py +++ b/tests/cms/views/link_replace/test_link_actions.py @@ -28,8 +28,8 @@ # Parameters for test # ( # , -# , -# +# , +# # ) url_replace_parameters = [("network_management", 4, 0), ("augsburg", 4, 1)] @@ -61,7 +61,7 @@ def test_url_replace( "url_id": url_object.id, } if not region == "network_management": - slugs.update( + kwargs.update( { "region_slug": region, } @@ -69,7 +69,7 @@ def test_url_replace( action_url = reverse( "edit_url", - kwargs=slugs, + kwargs=kwargs, ) with enable_listeners(): response = client.post( @@ -94,7 +94,7 @@ def test_url_replace( ) assert Link.objects.filter(url__url=OLD_URL).count() == after - # assert Link.objects.filter(url__url=NEW_URL).count() == before - after + assert Link.objects.filter(url__url=NEW_URL).count() == before - after elif role == ANONYMOUS: assert response.status_code == 302 @@ -152,7 +152,7 @@ def test_search_and_replace_links( kwargs = {} if not region == "network_management": - slugs.update( + kwargs.update( { "region_slug": region, } @@ -160,7 +160,7 @@ def test_search_and_replace_links( action_url = reverse( "search_and_replace_link", - kwargs=slugs, + kwargs=kwargs, ) with enable_listeners(): @@ -188,10 +188,10 @@ def test_search_and_replace_links( ) assert Link.objects.filter(url__url=SEARCH_REPLACE_TARGET_URL).count() == after - # assert ( - # Link.objects.filter(url__url=TARGET_URL_AFTER_REPLACE).count() - # == before - after - # ) + assert ( + Link.objects.filter(url__url=TARGET_URL_AFTER_REPLACE).count() + == before - after + ) elif role == ANONYMOUS: assert response.status_code == 302 @@ -260,9 +260,9 @@ def test_bulk_ignore_unignore_links( assert target_links.filter(ignore=True).count() == before[0] assert target_links.filter(ignore=False).count() == before[1] - slugs = {"url_filter": "valid"} + kwargs = {"url_filter": "valid"} if not region == "network_management": - slugs.update( + kwargs.update( { "region_slug": region, } @@ -270,7 +270,7 @@ def test_bulk_ignore_unignore_links( action_url = reverse( "linkcheck", - kwargs=slugs, + kwargs=kwargs, ) response = client.post( action_url, @@ -351,9 +351,9 @@ def test_bulk_recheck_links( unchecked_url, _ = filter_urls(region_slug, "unchecked") assert len(unchecked_url) == 1 - slugs = {"url_filter": "unchecked"} + kwargs = {"url_filter": "unchecked"} if not region == "network_management": - slugs.update( + kwargs.update( { "region_slug": region, } @@ -361,7 +361,7 @@ def test_bulk_recheck_links( action_url = reverse( "linkcheck", - kwargs=slugs, + kwargs=kwargs, ) response = client.post( action_url,