diff --git a/pygal/test/test_graph.py b/pygal/test/test_graph.py index 0040526..77df284 100644 --- a/pygal/test/test_graph.py +++ b/pygal/test/test_graph.py @@ -20,6 +20,7 @@ import os import pygal import uuid import sys +from pygal import i18n from pygal.util import cut from pygal._compat import u from pygal.test import pytest_generate_tests, make_data @@ -69,6 +70,8 @@ def test_metadata(Chart): v = range(7) if Chart == pygal.XY: v = list(map(lambda x: (x, x + 1), v)) + elif Chart == pygal.Worldmap: + v = list(map(lambda x: x, i18n.COUNTRIES)) chart.add('Serie with metadata', [ v[0], diff --git a/pygal/util.py b/pygal/util.py index d2cc7b1..8ab6958 100644 --- a/pygal/util.py +++ b/pygal/util.py @@ -346,6 +346,7 @@ def prepare_values(raw, config, cls): (width - len(raw_values)) * [None] # aligning values if len(raw_values) < width else [])): if isinstance(raw_value, dict): + raw_value = dict(raw_value) value = raw_value.pop('value', None) metadata[index] = raw_value else: