Remove sessions from test_misc.py

This commit is contained in:
Keith Edmunds 2025-04-13 09:21:36 +01:00
parent a2baf489c3
commit 5317ecdf18

View File

@ -7,7 +7,8 @@ import unittest
import pytest
# App imports
from app.models import db, Settings
from app.models import db
import ds
class TestMMMisc(unittest.TestCase):
@ -28,13 +29,9 @@ class TestMMMisc(unittest.TestCase):
NO_SUCH_SETTING = "abc"
VALUE = 3
with db.Session() as session:
setting = Settings(session, SETTING_NAME)
# test repr
_ = str(setting)
setting.f_int = VALUE
test = Settings.get_setting(session, SETTING_NAME)
assert test.name == SETTING_NAME
assert test.f_int == VALUE
test_new = Settings.get_setting(session, NO_SUCH_SETTING)
assert test_new.name == NO_SUCH_SETTING
test_non_existant = ds.setting_get(SETTING_NAME)
assert test_non_existant is None
ds.setting_set(SETTING_NAME, VALUE)
test_ok = ds.setting_get(SETTING_NAME)
assert test_ok == VALUE