add(FeatAPI): comment pytest.fixture

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-10-01 15:44:24 -07:00
parent 6644c42922
commit d3be30744c
No known key found for this signature in database
GPG key ID: F7E46DED420788F3

View file

@ -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. """