test: add mock test to database.

This commit is contained in:
estrella
2023-07-31 16:00:54 +08:00
parent d24acc60d5
commit 9b99e6c591
19 changed files with 92 additions and 106 deletions

View File

@@ -22,17 +22,6 @@ class UserDatabase(Session):
self.add(User())
self.commit()
# @staticmethod
# def __data_to_db(data: User) -> dict:
# db_data = data.dict()
# db_data["password"] = get_password_hash(db_data["password"])
# return db_data
#
# @staticmethod
# def __db_to_data(db_data: dict) -> User:
# return User(**db_data)
def get_user(self, username):
statement = select(User).where(User.username == username)
result = self.exec(statement).first()