3
0
Fork 0

fix: add WuttaDictEnum form schema type

This commit is contained in:
Lance Edgar 2025-01-08 12:29:42 -06:00
parent ae9ca8eee3
commit 517928320b
2 changed files with 50 additions and 0 deletions

View file

@ -81,6 +81,25 @@ class TestWuttaEnum(WebTestCase):
self.assertIsInstance(widget, widgets.SelectWidget)
MOCK_STATUS_ONE = 1
MOCK_STATUS_TWO = 2
MOCK_STATUS = {
MOCK_STATUS_ONE: 'one',
MOCK_STATUS_TWO: 'two',
}
class TestWuttaDictEnum(WebTestCase):
def test_widget_maker(self):
typ = mod.WuttaDictEnum(self.request, MOCK_STATUS)
widget = typ.widget_maker()
self.assertIsInstance(widget, widgets.SelectWidget)
self.assertEqual(widget.values, [
(1, 'one'),
(2, 'two'),
])
class TestWuttaMoney(WebTestCase):
def test_widget_maker(self):