Пример #1
0
 def test__permission_for_schema(self, mock__permission_for_link_schema,
                                 permission_user):
     schema, model = 'schema', ModelWithMeta
     PermissionToMapper.get.clear()
     PermissionPlugin._permission_for_schema(
         schema=schema, model=model, _permission_user=permission_user)
     mock__permission_for_link_schema.assert_called_once_with(
         schema=schema,
         prefix_name_column="",
         _permission_user=permission_user,
         columns={
             'id', 'name', 'type', 'flags', 'description', 'settings',
             'related_model_id'
         },
     )
Пример #2
0
 def test__permission_for_schema__no_permission_user(self):
     with pytest.raises(Exception) as e:
         PermissionPlugin._permission_for_schema(schema='schema',
                                                 model=ModelWithMeta)
     assert e.value.args[0] == 'No permission for user'