def test_package_comment_creation(user: User, pkgbase: PackageBase): with db.begin(): package_comment = db.create(PackageComment, PackageBase=pkgbase, User=user, Comments="Test comment.", RenderedComment="Test rendered comment.") assert bool(package_comment.ID)
def test_package_comment_null_renderedcomment_defaults(user: User, pkgbase: PackageBase): with db.begin(): record = db.create(PackageComment, PackageBase=pkgbase, User=user, Comments="Test comment.") assert record.RenderedComment == str()
def pkgbase(user: User) -> PackageBase: with db.begin(): pkgbase = db.create(PackageBase, Name="test-package", Maintainer=user) yield pkgbase
def user() -> User: with db.begin(): user = db.create(User, Username="******", Email="*****@*****.**", RealName="Test User", Passwd="testPassword", AccountTypeID=USER_ID) yield user
def package(user: User, license: License): with db.begin(): pkgbase = db.create(PackageBase, Name="test-package", Maintainer=user) package = db.create(Package, PackageBase=pkgbase, Name=pkgbase.Name) yield package
def license() -> License: with db.begin(): license = db.create(License, Name="Test License") yield license
def test_api_rate_key_ip_default(): with db.begin(): api_rate_limit = db.create(ApiRateLimit, Requests=10, WindowStart=1) assert api_rate_limit.IP == str()