mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
add(FeatAPI): comment pytest.fixture
Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
6644c42922
commit
d3be30744c
1 changed files with 14 additions and 0 deletions
|
@ -125,6 +125,20 @@ def package(maintainer: User) -> Package:
|
||||||
yield package
|
yield package
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def comment(user: User, package: Package) -> PackageComment:
|
||||||
|
pkgbase = package.PackageBase
|
||||||
|
now = int(datetime.utcnow().timestamp())
|
||||||
|
with db.begin():
|
||||||
|
comment = db.create(PackageComment,
|
||||||
|
User=user,
|
||||||
|
PackageBase=pkgbase,
|
||||||
|
Comments="Test comment.",
|
||||||
|
RenderedComment=str(),
|
||||||
|
CommentTS=now)
|
||||||
|
yield comment
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def packages(maintainer: User) -> List[Package]:
|
def packages(maintainer: User) -> List[Package]:
|
||||||
""" Yield 55 packages named pkg_0 .. pkg_54. """
|
""" Yield 55 packages named pkg_0 .. pkg_54. """
|
||||||
|
|
Loading…
Add table
Reference in a new issue