@pytest.mark.cmd
@pytest.mark.django_db
def test_export_tmx_tp(capfd, tp0, media_test_dir):
 lang_code = tp0.language.code
 prj_code = tp0.project.code
 call_command('export', '--tmx', ('--project=%s' % prj_code), ('--language=%s' % lang_code))
 (out, err) = capfd.readouterr()
 rev = revision.get(tp0.__class__)(tp0.directory).get(key='stats')
 filename = ('%s.%s.%s.tmx.zip' % (tp0.project.code, tp0.language.code, rev[:10]))
 assert (os.path.join(lang_code, filename) in out)
 call_command('export', '--tmx', ('--project=%s' % prj_code), ('--language=%s' % lang_code))
 (out, err) = capfd.readouterr()
 assert (('Translation project (%s) has not been changed' % tp0) in out)

@ pytest . mark . cmd @ pytest . mark . django_db def test_export_tmx_tp ( capfd , tp0 , media_test_dir ) : lang_code = tp0 . language . code prj_code = tp0 . project . code call_command ( 'export' , '--tmx' , ( '--project=%s' % prj_code ) , ( '--language=%s' % lang_code ) ) ( out , err ) = capfd . readouterr ( ) rev = revision . get ( tp0 . __class__ ) ( tp0 . directory ) . get ( key = 'stats' ) filename = ( '%s.%s.%s.tmx.zip' % ( tp0 . project . code , tp0 . language . code , rev [ : 10 ] ) ) assert ( os . path . join ( lang_code , filename ) in out ) call_command ( 'export' , '--tmx' , ( '--project=%s' % prj_code ) , ( '--language=%s' % lang_code ) ) ( out , err ) = capfd . readouterr ( ) assert ( ( 'Translation project (%s) has not been changed' % tp0 ) in out )
export a tp .