@pytest.mark.cmd
@pytest.mark.django_db
def test_import_onefile_with_user(capfd, tmpdir, site_users):
 from pootle_store.models import Store
 user = site_users['user'].username
 p = tmpdir.mkdir('sub').join('store0.po')
 store = Store.objects.get(pootle_path='/language0/project0/store0.po')
 p.write(str(get_translated_storefile(store)))
 call_command('import', ('--user=%s' % user), os.path.join(p.dirname, p.basename))
 (out, err) = capfd.readouterr()
 assert (user in out)
 assert ('[update]' in err)
 assert ('units in /language0/project0/store0.po' in err)

@ pytest . mark . cmd @ pytest . mark . django_db def test_import_onefile_with_user ( capfd , tmpdir , site_users ) : from pootle_store . models import Store user = site_users [ 'user' ] . username p = tmpdir . mkdir ( 'sub' ) . join ( 'store0.po' ) store = Store . objects . get ( pootle_path = '/language0/project0/store0.po' ) p . write ( str ( get_translated_storefile ( store ) ) ) call_command ( 'import' , ( '--user=%s' % user ) , os . path . join ( p . dirname , p . basename ) ) ( out , err ) = capfd . readouterr ( ) assert ( user in out ) assert ( '[update]' in err ) assert ( 'units in /language0/project0/store0.po' in err )
load an one unit po file .