feat: add per-row css class support for grids
This commit is contained in:
parent
f6fb6957e3
commit
e332975ce9
11 changed files with 253 additions and 75 deletions
|
@ -487,6 +487,20 @@ class TestMasterView(WebTestCase):
|
|||
grid = view.make_model_grid(session=self.session)
|
||||
self.assertIs(grid.model_class, model.Setting)
|
||||
|
||||
# no row class by default
|
||||
with patch.multiple(mod.MasterView, create=True,
|
||||
model_class=model.Setting):
|
||||
grid = view.make_model_grid(session=self.session)
|
||||
self.assertIsNone(grid.row_class)
|
||||
|
||||
# can specify row class
|
||||
get_row_class = MagicMock()
|
||||
with patch.multiple(mod.MasterView, create=True,
|
||||
model_class=model.Setting,
|
||||
grid_row_class=get_row_class):
|
||||
grid = view.make_model_grid(session=self.session)
|
||||
self.assertIs(grid.row_class, get_row_class)
|
||||
|
||||
# no actions by default
|
||||
with patch.multiple(mod.MasterView, create=True,
|
||||
model_class=model.Setting):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue