Commit 683b8ecf authored by Vincent Pelletier's avatar Vincent Pelletier

Add a check for tuple type.

Reorganize tests so that they are more intuitive.
Improve error message.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12805 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 115025e8
......@@ -616,8 +616,10 @@ class CategoryTool( UniqueObject, Folder, Base ):
category_list = (category_list,)
elif category_list is None:
category_list = ()
elif not isinstance(category_list, list):
raise TypeError, 'Category must be a string.'
elif isinstance(category_list, (list, tuple)):
pass
else:
raise TypeError, 'Category must be of string, tuple of string or list of string type.'
if isinstance(base_category_list, str):
base_category_list = [base_category_list]
new_category_list = []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment