'Ensures that invalid inputs result in errors with relevant output,
and that no persistent state is changed.'

@ddt.data(*((data, args, exception) for data in TEST_DATA for (args, exception) in (((), ('too    few    arguments' if (sys.version_info.major == 2) else 'required:    group_name')), ((('x' * 81),), 'invalid    group    name'), ((TEST_GROUP, 'some-other-group'), 'unrecognized    arguments'), ((TEST_GROUP, '--some-option', 'dummy'), 'unrecognized    arguments'))))
@ddt.unpack
def test_invalid_input(self, initial_group_permissions, command_args, exception_message):

    self.set_group_permissions(initial_group_permissions)
    with self.assertRaises(CommandError) as exc_context:
        call_command('manage_group', *command_args)
    self.assertIn(exception_message, str(exc_context.exception).lower())
    self.check_group_permissions(initial_group_permissions)
