2021-05-05 06:05:14 +00:00
|
|
|
from sqlalchemy import func
|
|
|
|
|
2021-05-06 05:21:50 +00:00
|
|
|
from amanuensis.db import *
|
2021-05-05 06:05:14 +00:00
|
|
|
|
|
|
|
|
2021-05-31 17:52:37 +00:00
|
|
|
def test_create_db(db: DbContext):
|
2021-05-05 06:05:14 +00:00
|
|
|
"""Simple test that the database creates fine from scratch."""
|
2021-05-06 07:04:15 +00:00
|
|
|
assert db.session.query(func.count(User.id)).scalar() == 0
|
|
|
|
assert db.session.query(func.count(Lexicon.id)).scalar() == 0
|
|
|
|
assert db.session.query(func.count(Membership.id)).scalar() == 0
|
|
|
|
assert db.session.query(func.count(Character.id)).scalar() == 0
|
|
|
|
assert db.session.query(func.count(Article.id)).scalar() == 0
|
|
|
|
assert db.session.query(func.count(ArticleIndex.id)).scalar() == 0
|
|
|
|
assert db.session.query(func.count(ArticleIndexRule.id)).scalar() == 0
|
|
|
|
assert db.session.query(func.count(ArticleContentRule.id)).scalar() == 0
|
|
|
|
assert db.session.query(func.count(Post.id)).scalar() == 0
|