3
0
Fork 0

feat: add basic data model support

wuttjamaican will provide a default data model with minimal tables;
it's assumed each custom app will extend this model with other tables
This commit is contained in:
Lance Edgar 2024-07-11 12:55:55 -05:00
parent 7012409e1e
commit 375d0be638
19 changed files with 388 additions and 13 deletions

View file

@ -88,6 +88,30 @@ class TestAppHandler(TestCase):
value = self.app.get_setting(session, 'foo')
self.assertEqual(value, 'bar')
def test_model(self):
try:
from wuttjamaican.db import model
except ImportError:
pytest.skip("test not relevant without sqlalchemy")
else:
self.assertNotIn('model', self.app.__dict__)
self.assertIs(self.app.model, model)
def test_get_model(self):
try:
from wuttjamaican.db import model
except ImportError:
pytest.skip("test not relevant without sqlalchemy")
else:
self.assertIs(self.app.get_model(), model)
def test_get_title(self):
self.assertEqual(self.app.get_title(), 'WuttJamaican')
def test_make_uuid(self):
uuid = self.app.make_uuid()
self.assertEqual(len(uuid), 32)
class TestAppProvider(TestCase):