19 lines
649 B
Python
19 lines
649 B
Python
from amanuensis.db import *
|
|
import amanuensis.backend.lexicon as lexiq
|
|
import amanuensis.backend.membership as memq
|
|
import amanuensis.backend.user as userq
|
|
|
|
from .test_db import db
|
|
|
|
|
|
def test_create_character(db: DbContext):
|
|
"""Test creating a character."""
|
|
# Set up a user and lexicon
|
|
new_user = userq.create(db, 'username', 'password', 'user', 'a@b.c', False)
|
|
assert new_user.id, 'Failed to create user'
|
|
new_lexicon = lexiq.create(db, 'Test', None, 'prompt')
|
|
assert new_lexicon.id, 'Failed to create lexicon'
|
|
mem = memq.create(db, new_user.id, new_lexicon.id, True)
|
|
assert mem, 'Failed to create membership'
|
|
|
|
# |