summaryrefslogtreecommitdiff
path: root/horizon/horizon/tests/table_tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'horizon/horizon/tests/table_tests.py')
-rw-r--r--horizon/horizon/tests/table_tests.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/horizon/horizon/tests/table_tests.py b/horizon/horizon/tests/table_tests.py
index 8784ffb5c..240ddb13b 100644
--- a/horizon/horizon/tests/table_tests.py
+++ b/horizon/horizon/tests/table_tests.py
@@ -475,6 +475,23 @@ class DataTableTests(test.TestCase):
self.assertEqual(list(req._messages)[0].message,
"Please select a row before taking that action.")
+ # At least one object in table
+ # BatchAction is available
+ req = self.factory.get('/my_url/')
+ self.table = MyTable(req, TEST_DATA_2)
+ self.assertQuerysetEqual(self.table.get_table_actions(),
+ ['<MyFilterAction: filter>',
+ '<MyAction: delete>',
+ '<MyBatchAction: batch>'])
+
+ # Zero objects in table
+ # BatchAction not available
+ req = self.factory.get('/my_url/')
+ self.table = MyTable(req, None)
+ self.assertQuerysetEqual(self.table.get_table_actions(),
+ ['<MyFilterAction: filter>',
+ '<MyAction: delete>'])
+
# Filtering
action_string = "my_table__filter__q"
req = self.factory.post('/my_url/', {action_string: '2'})