@pytest.mark.cmd
@pytest.mark.django_db
def test_import_bad_pootlepath(tmpdir):
 from pootle_store.models import Store
 p = tmpdir.join('store0.po')
 store = Store.objects.get(pootle_path='/language0/project0/store0.po')
 p.write(str(get_translated_storefile(store, pootle_path='language0/project0/store0.po')))
 with pytest.raises(CommandError) as e:
  call_command('import', os.path.join(p.dirname, p.basename))
 assert ('Missing Project/Language?' in str(e))

@ pytest . mark . cmd @ pytest . mark . django_db def test_import_bad_pootlepath ( tmpdir ) : from pootle_store . models import Store p = tmpdir . join ( 'store0.po' ) store = Store . objects . get ( pootle_path = '/language0/project0/store0.po' ) p . write ( str ( get_translated_storefile ( store , pootle_path = 'language0/project0/store0.po' ) ) ) with pytest . raises ( CommandError ) as e : call_command ( 'import' , os . path . join ( p . dirname , p . basename ) ) assert ( 'Missing Project/Language?' in str ( e ) )
bad x-pootle-path / missing before language0 .