feat: add "Last Updated" column to search results

Signed-off-by: moson-mo <mo-son@mailbox.org>
This commit is contained in:
moson-mo 2023-01-18 21:55:01 +01:00
parent becce1aac4
commit ec239ceeb3
No known key found for this signature in database
GPG key ID: 4A4760AB4EE15296
3 changed files with 23 additions and 1 deletions

View file

@ -5,7 +5,8 @@ from unittest import mock
import pytest
from fastapi.testclient import TestClient
from aurweb import asgi, db, time
from aurweb import asgi, config, db, time
from aurweb.filters import datetime_display
from aurweb.models import License, PackageLicense
from aurweb.models.account_type import USER_ID, AccountType
from aurweb.models.dependency_type import DependencyType
@ -1085,6 +1086,11 @@ def test_packages_sort_by_last_modified(client: TestClient, packages: list[Packa
col = row.xpath("./td")[0].xpath("./a")[0]
assert col.text.strip() == package.Name
# Make sure our row contains the modified date we've set
tz = config.get("options", "default_timezone")
dt = datetime_display({"timezone": tz}, package.PackageBase.ModifiedTS)
assert dt in "".join(row.itertext())
def test_packages_flagged(
client: TestClient, maintainer: User, packages: list[Package]