diff --git a/templates/partials/packages/details.html b/templates/partials/packages/details.html index 7e20b082..c9b95a26 100644 --- a/templates/partials/packages/details.html +++ b/templates/partials/packages/details.html @@ -70,7 +70,7 @@ {% endif %} {% if show_package_details and conflicts and conflicts.count() %} - + {{ "Conflicts" | tr }}: {{ conflicts.all() | join(', ', attribute='RelName') }} diff --git a/test/test_packages_routes.py b/test/test_packages_routes.py index b00844c2..1dabada8 100644 --- a/test/test_packages_routes.py +++ b/test/test_packages_routes.py @@ -24,7 +24,7 @@ from aurweb.models.package_notification import PackageNotification from aurweb.models.package_relation import PackageRelation from aurweb.models.package_request import ACCEPTED_ID, REJECTED_ID, PackageRequest from aurweb.models.package_vote import PackageVote -from aurweb.models.relation_type import PROVIDES_ID, REPLACES_ID, RelationType +from aurweb.models.relation_type import CONFLICTS_ID, PROVIDES_ID, REPLACES_ID, RelationType from aurweb.models.request_type import DELETION_ID, MERGE_ID, RequestType from aurweb.models.user import User from aurweb.testing import setup_test_db @@ -233,6 +233,13 @@ def test_package(client: TestClient, package: Package): RelTypeID=REPLACES_ID, RelName="test_replacer2") + db.create(PackageRelation, PackageID=package.ID, + RelTypeID=CONFLICTS_ID, + RelName="test_conflict1") + db.create(PackageRelation, PackageID=package.ID, + RelTypeID=CONFLICTS_ID, + RelName="test_conflict2") + with client as request: resp = request.get(package_endpoint(package)) assert resp.status_code == int(HTTPStatus.OK) @@ -261,6 +268,10 @@ def test_package(client: TestClient, package: Package): expected = ["test_replacer1", "test_replacer2"] assert replaces[0].text.strip() == ", ".join(expected) + conflicts = root.xpath('//tr[@id="conflicts"]/td') + expected = ["test_conflict1", "test_conflict2"] + assert conflicts[0].text.strip() == ", ".join(expected) + def test_package_comments(client: TestClient, user: User, package: Package): now = (datetime.utcnow().timestamp())