@pytest.mark.cmd
@pytest.mark.django_db
def test_changed_languages_since_revision(capfd, project0_nongnu, tp0):
 for store in tp0.stores.all():
  store.sync()
 rev = (tp0.stores.aggregate(rev=Min('last_sync_revision'))['rev'] - 1)
 call_command('changed_languages', ('--after-revision=%s' % rev))
 (out, err) = capfd.readouterr()
 assert (out == u'language0,language1,templates\n')
 revision = Revision.get()
 unit = tp0.stores.first().units.first()
 unit.target = 'NEW TARGET'
 unit.save()
 call_command('changed_languages', ('--after-revision=%s' % revision))
 (out, err) = capfd.readouterr()
 assert (out == u'language0\n')

@ pytest . mark . cmd @ pytest . mark . django_db def test_changed_languages_since_revision ( capfd , project0_nongnu , tp0 ) : for store in tp0 . stores . all ( ) : store . sync ( ) rev = ( tp0 . stores . aggregate ( rev = Min ( 'last_sync_revision' ) ) [ 'rev' ] - 1 ) call_command ( 'changed_languages' , ( '--after-revision=%s' % rev ) ) ( out , err ) = capfd . readouterr ( ) assert ( out == u'language0,language1,templates\n' ) revision = Revision . get ( ) unit = tp0 . stores . first ( ) . units . first ( ) unit . target = 'NEW TARGET' unit . save ( ) call_command ( 'changed_languages' , ( '--after-revision=%s' % revision ) ) ( out , err ) = capfd . readouterr ( ) assert ( out == u'language0\n' )
changed languages since a given revision .