Fix `test_to_dict_enum` under Python3