housekeep(fastapi): rewrite test_package_blacklist

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-11-30 16:25:04 -08:00
parent adafa6ebc1
commit 735c5f57cb
No known key found for this signature in database
GPG key ID: F7E46DED420788F3

View file

@ -3,21 +3,12 @@ import pytest
from sqlalchemy.exc import IntegrityError from sqlalchemy.exc import IntegrityError
from aurweb import db from aurweb import db
from aurweb.models.package_base import PackageBase
from aurweb.models.package_blacklist import PackageBlacklist from aurweb.models.package_blacklist import PackageBlacklist
from aurweb.models.user import User
user = pkgbase = None
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)
def setup(db_test): def setup(db_test):
global user, pkgbase return
with db.begin():
user = db.create(User, Username="test", Email="test@example.org",
RealName="Test User", Passwd="testPassword")
pkgbase = db.create(PackageBase, Name="test-package", Maintainer=user)
def test_package_blacklist_creation(): def test_package_blacklist_creation():