diff --git a/templates/partials/packages/details.html b/templates/partials/packages/details.html index 8ecf9bd8..697ef724 100644 --- a/templates/partials/packages/details.html +++ b/templates/partials/packages/details.html @@ -53,7 +53,7 @@ {% for keyword in pkgbase.keywords.all() %} {{ keyword.Keyword }} diff --git a/test/test_packages_routes.py b/test/test_packages_routes.py index c8986b9c..bf179963 100644 --- a/test/test_packages_routes.py +++ b/test/test_packages_routes.py @@ -271,6 +271,13 @@ def test_package(client: TestClient, package: Package): db.create(PackageLicense, PackageID=package.ID, License=licenses[0]) db.create(PackageLicense, PackageID=package.ID, License=licenses[1]) + # Create some keywords + keywords = ["test1", "test2"] + for keyword in keywords: + db.create( + PackageKeyword, PackageBaseID=package.PackageBaseID, Keyword=keyword + ) + with client as request: resp = request.get(package_endpoint(package)) assert resp.status_code == int(HTTPStatus.OK) @@ -307,6 +314,11 @@ def test_package(client: TestClient, package: Package): expected = ["test_conflict1", "test_conflict2"] assert conflicts[0].text.strip() == ", ".join(expected) + keywords = root.xpath('//a[@class="keyword"]') + expected = ["test1", "test2"] + for i, keyword in enumerate(expected): + assert keywords[i].text.strip() == keyword + def test_package_split_description(client: TestClient, user: User):