Skip to content
Snippets Groups Projects
Commit a04c784e authored by Alice Heaton's avatar Alice Heaton :speech_balloon:
Browse files

Add a table widget test to ensure category and delete fields are hidden.

parent e68aa938
No related branches found
No related tags found
No related merge requests found
......@@ -55,3 +55,14 @@ class TestTableWidget(TestCase):
self.assertEqual(processed_rows, [
{'a': 4}, {'a': 2}, {'a': 1}
])
def test_get_context_data_table_excludes_category_and_delete(self):
widget = TableWidget()
with patch('hid.widgets.table.transport.items.list') as mock:
mock.return_value = []
with patch('hid.widgets.table.ItemTable') as mock_table:
widget.get_context_data()
excludes = mock_table.call_args[1]['exclude']
self.assertEqual(set(excludes), set([
'category', 'delete'
]))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment