@pytest.mark.cmd
@pytest.mark.django_db
def __test_update_tmserver_noargs(capfd, tp0, settings):
 from pootle_store.models import Unit
 units_qs = Unit.objects.exclude(target_f__isnull=True).exclude(target_f__exact='')
 settings.POOTLE_TM_SERVER = {'local': {'ENGINE': 'pootle.core.search.backends.ElasticSearchBackend', 'HOST': 'localhost', 'PORT': 9200, 'INDEX_NAME': 'translations'}}
 call_command('update_tmserver')
 (out, err) = capfd.readouterr()
 assert ('Last indexed revision = -1' in out)
 assert (('%d translations to index' % units_qs.count()) in out)

@ pytest . mark . cmd @ pytest . mark . django_db def __test_update_tmserver_noargs ( capfd , tp0 , settings ) : from pootle_store . models import Unit units_qs = Unit . objects . exclude ( target_f__isnull = True ) . exclude ( target_f__exact = '' ) settings . POOTLE_TM_SERVER = { 'local' : { 'ENGINE' : 'pootle.core.search.backends.ElasticSearchBackend' , 'HOST' : 'localhost' , 'PORT' : 9200 , 'INDEX_NAME' : 'translations' } } call_command ( 'update_tmserver' ) ( out , err ) = capfd . readouterr ( ) assert ( 'Last indexed revision = -1' in out ) assert ( ( '%d translations to index' % units_qs . count ( ) ) in out )
load tm from the database .