fix: add basic support for row grid "view" action links
still no actual "view row" support just yet, but subclass can implement however they like..
This commit is contained in:
parent
170afe650b
commit
86ffb5d58f
2 changed files with 47 additions and 0 deletions
|
@ -1655,6 +1655,18 @@ class TestMasterView(WebTestCase):
|
|||
self.assertIsNone(grid.model_class)
|
||||
self.assertEqual(grid.data, [])
|
||||
|
||||
# view action
|
||||
with patch.object(view, 'rows_viewable', new=True):
|
||||
with patch.object(view, 'get_row_action_url_view', return_value='#'):
|
||||
grid = view.make_row_model_grid(person, data=[])
|
||||
self.assertEqual(len(grid.actions), 1)
|
||||
self.assertEqual(grid.actions[0].key, 'view')
|
||||
|
||||
def test_get_row_action_url_view(self):
|
||||
view = self.make_view()
|
||||
row = MagicMock()
|
||||
self.assertRaises(NotImplementedError, view.get_row_action_url_view, row, 0)
|
||||
|
||||
def test_get_rows_title(self):
|
||||
view = self.make_view()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue