okfn/ckan — pull request #754 by vitorbaptista (2013-04-11 15:53:56+00:00)
Title: Change member_create and member_delete to accept object's id or name, and throw better errors

Fixes #747

As per member_create documentation, it should already accept the object's id or its name, but it wasn't. I fixed that, and changed member_delete to accept the same, so it's more coherent.

I've also refactored the tests, and added more validations, so the code is more resilient.

I still feel that we're missing validations in the capacity. But, as I couldn't find a list of all valid values, I didn't add it yet.

Also, when I added exceptions to be thrown when i.e. the group wasn't found using localized strings, I found other places were the same error was being thrown but with literal strings. I've changed these to be localized as well.