Initial config with email service test
Build LinkLog Development Image / development-image (push) Successful in 11s

This commit is contained in:
Olaf
2026-08-25 23:23:28 +02:00
parent defe7a83a9
commit 102d8e533c
20 changed files with 482 additions and 34 deletions
+32
View File
@@ -0,0 +1,32 @@
## Copyright © 2026 Olaf Kolkman
## SPDX-License-Identifier: GPL-3.0-or-later
import os
import tempfile
import pytest
TEST_DATABASE_DIRECTORY = tempfile.TemporaryDirectory(prefix='linklog-tests-')
TEST_DATABASE_PATH = os.path.join(TEST_DATABASE_DIRECTORY.name, 'linklog.db')
os.environ['LINKLOG_DATABASE_PATH'] = TEST_DATABASE_PATH
@pytest.fixture(scope='session', autouse=True)
def test_users():
from backend.app.database import get_connection, hash_password, init_db
init_db()
with get_connection() as conn:
conn.executemany(
'''INSERT INTO users
(id, username, email, password_hash, is_admin, email_verified)
VALUES (?, ?, ?, ?, ?, 1)''',
[
('user-1', 'alice', 'alice@example.com', hash_password('secret123'), 1),
('user-2', 'bob', 'bob@example.com', hash_password('secret123'), 0),
],
)
conn.commit()
yield
TEST_DATABASE_DIRECTORY.cleanup()