diff --git a/aurweb/packages/util.py b/aurweb/packages/util.py index 21b5fab8..ded1554f 100644 --- a/aurweb/packages/util.py +++ b/aurweb/packages/util.py @@ -98,17 +98,10 @@ def get_pkg_or_base( :raises HTTPException: With status code 404 if record doesn't exist :return: {Package,PackageBase} instance """ - provider = db.query(models.OfficialProvider).filter( - models.OfficialProvider.Name == name).first() - if provider: - raise HTTPException(status_code=HTTPStatus.NOT_FOUND) - with db.begin(): instance = db.query(cls).filter(cls.Name == name).first() - if not instance: raise HTTPException(status_code=HTTPStatus.NOT_FOUND) - return instance diff --git a/test/test_packages_routes.py b/test/test_packages_routes.py index adafe1ae..ee837912 100644 --- a/test/test_packages_routes.py +++ b/test/test_packages_routes.py @@ -203,21 +203,6 @@ def test_package_not_found(client: TestClient): assert resp.status_code == int(HTTPStatus.NOT_FOUND) -def test_package_official_not_found(client: TestClient, package: Package): - """ When a Package has a matching OfficialProvider record, it is not - hosted on AUR, but in the official repositories. Getting a package - with this kind of record should return a status code 404. """ - with db.begin(): - db.create(OfficialProvider, - Name=package.Name, - Repo="core", - Provides=package.Name) - - with client as request: - resp = request.get(package_endpoint(package)) - assert resp.status_code == int(HTTPStatus.NOT_FOUND) - - def test_package(client: TestClient, package: Package): """ Test a single / packages / {name} route. """