def test_reimport_actions(self):
        from collective.cart.core.tests.test_setup import get_action
        self.assertIsNotNone(get_action(self.portal, 'object', 'article-list'))

        category = getattr(getToolByName(self.portal, 'portal_actions'), 'object')
        category.manage_delObjects(['article-list'])

        with self.assertRaises(AttributeError):
            get_action(self.portal, 'object', 'article-list')

        from collective.cart.shopping.upgrades import reimport_actions
        reimport_actions(self.portal)

        self.assertIsNotNone(get_action(self.portal, 'object', 'article-list'))
 def test_actions__object_stock__visible(self):
     action = get_action(self.portal, 'object', 'stock')
     self.assertTrue(action.visible)
 def test_actions__object_stock__permissions(self):
     action = get_action(self.portal, 'object', 'stock')
     self.assertEqual(action.permissions, ('Modify portal content',))
 def test_actions__object_stock__available_expr(self):
     action = get_action(self.portal, 'object', 'stock')
     self.assertEqual(
         action.available_expr, 'python: object.restrictedTraverse("is-article")()')
 def test_actions__object_stock__url_expr(self):
     action = get_action(self.portal, 'object', 'stock')
     self.assertEqual(
         action.url_expr, 'string:${globals_view/getCurrentFolderUrl}/@@stock')
 def test_actions__object_stock__description(self):
     action = get_action(self.portal, 'object', 'stock')
     self.assertEqual(action.description, '')
 def test_actions__object_stock__title(self):
     action = get_action(self.portal, 'object', 'stock')
     self.assertEqual(action.title, 'Stock')
 def test_actions__object_stock__i18n_domain(self):
     action = get_action(self.portal, 'object', 'stock')
     self.assertEqual(action.i18n_domain, 'collective.cart.shopping')
 def test_actions__object_stock__meta_type(self):
     action = get_action(self.portal, 'object', 'stock')
     self.assertEqual(action.meta_type, 'CMF Action')