Beispiel #1
0
def test_supranationalworldmap():
    set_countries(_COUNTRIES, True)
    datas = {}
    for i, supra in enumerate(SUPRANATIONAL):
        datas[supra] = i + 1

    wmap = SupranationalWorldmap()
    wmap.add('supra', datas)
    q = wmap.render_pyquery()
    assert len(q('.country.color-0')) == len(
        reduce(operator.or_, map(set, SUPRANATIONAL.values())))
Beispiel #2
0
def test_supranationalworldmap():
    set_countries(_COUNTRIES, True)
    datas = {}
    for i, supra in enumerate(SUPRANATIONAL):
        datas[supra] = i + 1

    wmap = SupranationalWorldmap()
    wmap.add('supra', datas)
    q = wmap.render_pyquery()
    assert len(
        q('.country.color-0')
    ) == len(
        reduce(operator.or_, map(set, SUPRANATIONAL.values())))
Beispiel #3
0
    def test_supranational():
        wmap = SupranationalWorldmap(style=choice(list(styles.values())))

        wmap.add('Asia', [('asia', 1)])
        wmap.add('Europe', [('europe', 1)])
        wmap.add('Africa', [('africa', 1)])
        wmap.add('North america', [('north_america', 1)])
        wmap.add('South america', [('south_america', 1)])
        wmap.add('Oceania', [('oceania', 1)])
        wmap.add('Antartica', [('antartica', 1)])

        wmap.title = 'Supra World Map !!'
        return wmap.render_response()