Beispiel #1
0
def test_worldmap_i18n_clear():
    set_countries(_COUNTRIES, True)
    wmap = Worldmap()
    wmap.add('countries', dict(fr=12))
    set_countries({'fr': 'Frankreich'}, clear=True)
    q = wmap.render_pyquery()
    assert len(q('.country.color-0')) == 1
    assert 'Frankreich' in q('#fr').text()
Beispiel #2
0
def test_worldmap_i18n_clear():
    set_countries(_COUNTRIES, True)
    wmap = Worldmap()
    wmap.add('countries', dict(fr=12))
    set_countries({'fr': 'Frankreich'}, clear=True)
    q = wmap.render_pyquery()
    assert len(
        q('.country.color-0')
    ) == 1
    assert 'Frankreich' in q('.country.fr').text()
Beispiel #3
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 #4
0
def test_worldmap():
    set_countries(_COUNTRIES, True)
    datas = {}
    for i, ctry in enumerate(COUNTRIES):
        datas[ctry] = i

    wmap = Worldmap()
    wmap.add('countries', datas)
    q = wmap.render_pyquery()
    assert len(q('.country.color-0')) == len(COUNTRIES)
    assert 'France' in q('#fr').text()
Beispiel #5
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 #6
0
def test_worldmap():
    set_countries(_COUNTRIES, True)
    datas = {}
    for i, ctry in enumerate(COUNTRIES):
        datas[ctry] = i

    wmap = Worldmap()
    wmap.add('countries', datas)
    q = wmap.render_pyquery()
    assert len(
        q('.country.color-0')
    ) == len(COUNTRIES)
    assert 'France' in q('.country.fr').text()