feat: add basic master view class for batches
no support for displaying rows yet, just the main batch CRUD
This commit is contained in:
parent
d72a2a15ec
commit
5006c97b4b
7 changed files with 516 additions and 2 deletions
|
@ -302,3 +302,23 @@ class TestPermissionsWidget(WebTestCase):
|
|||
# editable output always includes the perm
|
||||
html = widget.serialize(field, set())
|
||||
self.assertIn("Polish the widgets", html)
|
||||
|
||||
|
||||
class TestBatchIdWidget(WebTestCase):
|
||||
|
||||
def make_field(self, node, **kwargs):
|
||||
# TODO: not sure why default renderer is in use even though
|
||||
# pyramid_deform was included in setup? but this works..
|
||||
kwargs.setdefault('renderer', deform.Form.default_renderer)
|
||||
return deform.Field(node, **kwargs)
|
||||
|
||||
def test_serialize(self):
|
||||
node = colander.SchemaNode(colander.Integer())
|
||||
field = self.make_field(node)
|
||||
widget = mod.BatchIdWidget()
|
||||
|
||||
result = widget.serialize(field, colander.null)
|
||||
self.assertIs(result, colander.null)
|
||||
|
||||
result = widget.serialize(field, 42)
|
||||
self.assertEqual(result, '00000042')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue