I'd like to see more tests for error conditions here.  What happens if the user doesn't exist?  Or the group isn't defined?  Or you specify a level that's not in the list of expected levels?

If the expected behavior is to throw an exception, I suggest defining a custom exception (such as `UndefinedLevelError`) and then checking that you get it with `self.assertRaises()`.  That way, if there are unexpected exceptions that you don't explicitly throw, the tests will fail.