def test_translation(self): # print microsoft_translate(u'English', 'en', 'es') # print type(microsoft_translate(u'Español', 'es', 'en')) # assert microsoft_translate(u'English', 'en', 'es') == u'Inglés' # assert microsoft_translate(u'Español', 'es', 'en') == u'Spanish' assert microsoft_translate(u'English', 'en', 'es') == 'Inglés' assert microsoft_translate(u'Español', 'es', 'en') == 'Spanish'
# # # # get all users in reverse alphabetical order # print models.User.query.order_by('nickname desc').all() # from app.models import Post # from app import db # for post in Post.query.all(): # db.session.delete(post) # db.session.commit() # from flask.ext.mail import Message # from app import app, mail # from config import ADMINS # msg = Message('test subject', sender=ADMINS[0], recipients=ADMINS) # msg.body = 'text body' # msg.html = '<b>HTML</b> body' # # # def send_async_email(msg): # with app.app_context(): # print msg # mail.send(msg) # # thr = Thread(target=send_async_email(msg), args=app.app_context()) # from app import translate print translate.microsoft_translate('Hi, how are you?', 'en', 'he')
def test_translation(self): assert microsoft_translate(u'English', 'en', 'es') == u'Ingls' assert microsoft_translate(u'Español', 'es', 'en') == u'Spanish'
def test_translation(self): assert microsoft_translate(u'English', 'en', 'es') == u'\ufeff"Ingl\xe9s"' assert microsoft_translate(u'Español', 'es', 'en') == u'\ufeff"Spanish"'
def test_translation(self): assert microsoft_translate(u'English', 'en', 'es') == u'Inglés' assert microsoft_translate(u'Español', 'es', 'en') == u'Spanish'
def test_translation(self): assert microsoft_translate(u'English', 'en', 'es') == u'Inglés'
def translate(): return jsonify({ 'text': microsoft_translate(request.form['text'], request.form['sourceLang'], request.form['destLang']) })
def test_translation(self): assert unicode(microsoft_translate('English', 'en', 'ru'), "unicode-escape") == 'Английский' assert microsoft_translate('Español', 'es', 'en') == 'Spanish'
def test_translation(self): assert microsoft_translate(u'English', 'en', 'zh') == u'英语' assert microsoft_translate(u'中文', 'zh', 'en') == u'Chinese'
def test_translation(self): # This fails but does not give an error assert microsoft_translate(u'English', 'en', 'es') == u'Inglés' assert microsoft_translate(u'Español', 'es', 'en') == u'Spanish' assert microsoft_translate(u'Deutsch', 'de', 'en') == u'German' assert microsoft_translate(u'English', 'en', 'de') == u'Englisch'
def translate(): return jsonify({ 'text': microsoft_translate( request.form['text'], request.form['sourceLang'], request.form['destLang']) })
def test_translation(self): assert microsoft_translate(u'English', 'en', 'fr') == u'Anglais' assert microsoft_translate(u'Français', 'fr', 'en') == u'French'
def test_translation(self): assert microsoft_translate(u'Hi, how are you today?', 'en', 'es') == u'Hola, \xbfc\xf3mo est\xe1s hoy?' assert microsoft_translate(u'Español', 'es', 'en') == u'Spanish' assert microsoft_translate(u'Español', 'es', 'en') == u'Spanish'