@pytest.mark.cmd
@pytest.mark.django_db
def test_update_tmserver_bad_tm(capfd, settings):
 settings.POOTLE_TM_SERVER = {'local': {'ENGINE': 'pootle.core.search.backends.ElasticSearchBackend', 'HOST': 'localhost', 'PORT': 9200, 'INDEX_NAME': 'translations'}}
 with pytest.raises(CommandError) as e:
  call_command('update_tmserver', '--tm=i_dont_exist')
 assert ("Translation Memory 'i_dont_exist' is not defined" in str(e))

@ pytest . mark . cmd @ pytest . mark . django_db def test_update_tmserver_bad_tm ( capfd , settings ) : settings . POOTLE_TM_SERVER = { 'local' : { 'ENGINE' : 'pootle.core.search.backends.ElasticSearchBackend' , 'HOST' : 'localhost' , 'PORT' : 9200 , 'INDEX_NAME' : 'translations' } } with pytest . raises ( CommandError ) as e : call_command ( 'update_tmserver' , '--tm=i_dont_exist' ) assert ( "Translation Memory 'i_dont_exist' is not defined" in str ( e ) )
non-existant tm in the server .