Add first info to landing page
This commit is contained in:
19
test/test_database.py
Normal file
19
test/test_database.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from sqlalchemy import func, select
|
||||
|
||||
from allmende_payment_system.database import ensure_user
|
||||
from allmende_payment_system.models import User
|
||||
|
||||
|
||||
def test_ensure_user(test_db):
|
||||
|
||||
user_info = {"username": "test", "display_name": "Test User"}
|
||||
user = ensure_user(user_info, test_db)
|
||||
|
||||
assert user.username == "test"
|
||||
|
||||
test_db.commit()
|
||||
|
||||
assert test_db.scalar(select(func.count()).select_from(User)) == 1
|
||||
|
||||
user = ensure_user(user_info, test_db)
|
||||
assert test_db.scalar(select(func.count()).select_from(User)) == 1
|
||||
Reference in New Issue
Block a user