Exemple #1
0
 def test_type_info_unaddable(self):
     from kotti.resources import TypeInfo
     type_info = TypeInfo(add_view=None, addable_to=['Document'])
     context = Mock(type_info=Mock())
     context.type_info.name = 'Document'
     with patch('kotti.resources.view_permitted') as vp:
         res = type_info.addable(context, None)
         assert vp.call_count == 0
Exemple #2
0
 def test_type_info_unaddable(self):
     from kotti.resources import TypeInfo
     type_info = TypeInfo(add_view=None, addable_to=['Document'])
     context = Mock(type_info=Mock())
     context.type_info.name = 'Document'
     with patch('kotti.resources.view_permitted') as vp:
         res = type_info.addable(context, None)
         assert vp.call_count == 0