Пример #1
0
def test_parse_search_empty_shortname():
    fname = get_file('search_empty_shortname.xml')

    with pytest.raises(forms.ValidationError) as excinfo:
        utils.parse_search(fname)

    assert (
        excinfo.value[0] ==
        'Could not parse uploaded file, missing or empty <ShortName> element')
Пример #2
0
def test_parse_search_empty_shortname():
    fname = get_file('search_empty_shortname.xml')

    with pytest.raises(forms.ValidationError) as excinfo:
        utils.parse_search(fname)

    assert (
        six.text_type(excinfo.value.message) ==
        'Could not parse uploaded file, missing or empty <ShortName> element')
Пример #3
0
def test_parse_search_empty_shortname():
    from olympia.files.tests.test_file_viewer import get_file

    fname = get_file('search_empty_shortname.xml')

    with pytest.raises(forms.ValidationError) as excinfo:
        utils.parse_search(fname)

    assert (str(
        excinfo.value.message
    ) == 'Could not parse uploaded file, missing or empty <ShortName> element')