From 3b1eb22e7215940d1da0c8d9dbc787d472550482 Mon Sep 17 00:00:00 2001 From: Lacey Williams Henschel Date: Wed, 8 Feb 2023 11:34:38 -0800 Subject: [PATCH] :pencil: Remove "libraries" from library detail URL --- config/urls.py | 10 +++++----- libraries/tests/test_views.py | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/config/urls.py b/config/urls.py index 247cb020..d96475f2 100755 --- a/config/urls.py +++ b/config/urls.py @@ -141,16 +141,16 @@ urlpatterns = [ ), path("contact/", ContactView.as_view(), name="contact"), # Boost versions views - path( - "versions//libraries//", - LibraryByVersionDetail.as_view(), - name="libraries-by-version-detail", - ), path( "versions//libraries/", LibraryByVersion.as_view(), name="libraries-by-version", ), + path( + "versions///", + LibraryByVersionDetail.as_view(), + name="libraries-by-version-detail", + ), path( "versions//libraries-by-category//", LibraryVersionByCategory.as_view(), diff --git a/libraries/tests/test_views.py b/libraries/tests/test_views.py index 89066b36..73c0b4a6 100644 --- a/libraries/tests/test_views.py +++ b/libraries/tests/test_views.py @@ -46,7 +46,7 @@ def test_libraries_by_version_by_category(tp, library_version, category): def test_libraries_by_version_detail(tp, library_version): - """GET /versions/{version_identifier}/libraries/{slug}/""" + """GET /versions/{version_slug}/{slug}/""" res = tp.get( "libraries-by-version-detail", library_version.version.pk, @@ -57,7 +57,7 @@ def test_libraries_by_version_detail(tp, library_version): def test_libraries_by_version_detail_no_library_found(tp, library_version): - """GET /versions/{version_identifier}/libraries/{slug}/""" + """GET /versions/{version_slug}/{slug}/""" res = tp.get( "libraries-by-version-detail", library_version.version.pk, @@ -67,7 +67,7 @@ def test_libraries_by_version_detail_no_library_found(tp, library_version): def test_libraries_by_version_detail_no_version_found(tp, library_version): - """GET /versions/{version_identifier}/libraries/{slug}/""" + """GET /versions/{version_slug}/{slug}/""" res = tp.get( "libraries-by-version-detail", 0000, @@ -77,7 +77,7 @@ def test_libraries_by_version_detail_no_version_found(tp, library_version): def test_libraries_by_version_list(tp, library_version): - """GET /versions/{version_identifier}/libraries/""" + """GET /versions/{version_slug}/libraries/""" # Create a new library_version excluded_library = baker.make("libraries.Library", name="Sample") res = tp.get("libraries-by-version", library_version.version.pk) @@ -92,7 +92,7 @@ def test_libraries_by_version_list(tp, library_version): def test_library_detail_context_get_closed_prs_count(tp, library_version): """ - GET /libraries/{repo}/ + GET /versions/{version_slug}/{slug}/ Test that the custom closed_prs_count var appears as expected """ library = library_version.library @@ -113,7 +113,7 @@ def test_library_detail_context_get_closed_prs_count(tp, library_version): def test_library_detail_context_get_open_issues_count(tp, library_version): """ - GET /libraries/{repo}/ + GET /versions/{version_slug}/{slug}/ Test that the custom open_issues_count var appears as expected """ library = library_version.library @@ -133,10 +133,10 @@ def test_library_detail_context_get_open_issues_count(tp, library_version): def test_library_detail(library_version, tp): - """GET /libraries/{slug}/""" + """GET /versions/{version_slug}/{slug}/""" library = library_version.library version = library_version.version url = tp.reverse("library-detail", library.slug) response = tp.get(url) tp.response_302(response) - assert response.url == f"/versions/{version.pk}/libraries/{library.slug}/" + assert response.url == f"/versions/{version.pk}/{library.slug}/"