mirror of
https://github.com/boostorg/website-v2.git
synced 2026-02-27 05:32:08 +00:00
🔧 Fixes for library-detail-by-version view
This commit is contained in:
@@ -139,7 +139,7 @@ urlpatterns = [
|
||||
path(
|
||||
"versions/<slug:version_slug>/libraries/<slug:slug>/",
|
||||
LibraryDetailByVersion.as_view(),
|
||||
name="libraries-by-version-detail",
|
||||
name="library-detail-by-version",
|
||||
),
|
||||
path(
|
||||
"versions/<slug:slug>/libraries/",
|
||||
|
||||
@@ -27,10 +27,10 @@ def test_libraries_by_category(tp, library, category):
|
||||
|
||||
|
||||
def test_libraries_by_version_detail(tp, library_version):
|
||||
"""GET /versions/{version_identifier}/libraries/{slug}/"""
|
||||
"""GET /versions/{version_slug}/libraries/{slug}/"""
|
||||
res = tp.get(
|
||||
"libraries-by-version-detail",
|
||||
library_version.version.pk,
|
||||
"library-detail-by-version",
|
||||
library_version.version.slug,
|
||||
library_version.library.slug,
|
||||
)
|
||||
tp.response_200(res)
|
||||
@@ -40,13 +40,23 @@ 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}/"""
|
||||
res = tp.get(
|
||||
"libraries-by-version-detail",
|
||||
library_version.version.pk,
|
||||
"library-detail-by-version",
|
||||
library_version.version.slug,
|
||||
"coffee",
|
||||
)
|
||||
tp.response_404(res)
|
||||
|
||||
|
||||
def test_libraries_by_version_detail_no_version_found(tp, library_version):
|
||||
"""GET /versions/{version_identifier}/libraries/{slug}/"""
|
||||
res = tp.get(
|
||||
"library-detail-by-version",
|
||||
"coffee",
|
||||
library_version.library.slug,
|
||||
)
|
||||
tp.response_404(res)
|
||||
|
||||
|
||||
def test_libraries_by_version(tp, library_version):
|
||||
"""GET /versions/{version_identifier}/libraries/"""
|
||||
# Create a new library_version
|
||||
|
||||
@@ -84,7 +84,7 @@ class LibraryDetailByVersion(CategoryMixin, DetailView):
|
||||
|
||||
try:
|
||||
obj = self.get_queryset().get(slug=slug)
|
||||
except queryset.model.DoesNotExist:
|
||||
except self.model.DoesNotExist:
|
||||
raise Http404("No library found matching the query")
|
||||
return obj
|
||||
|
||||
|
||||
Reference in New Issue
Block a user