def get_user_record(c, user_id): """ Get user record from the database with the specified user ID. """ if not has_table('user'): return None users = get_table('user') stmt = select([users]).where(users.c._id == user_id) result = c.execute(stmt) return result.fetchone()
def test_has_table_nonexistent(self): assert db.has_table('something') is False
def test_has_table(self): assert db.has_table('note') is True