add tests for unicode strings in wolframalpha

This commit is contained in:
a01200356 2016-01-03 19:57:37 -06:00
parent e5d51a0e98
commit d997265e55
3 changed files with 186 additions and 212 deletions

View file

@ -73,11 +73,11 @@ def response(resp):
results.append({'answer': answer})
# user input is in first part of title
title = dom.xpath(title_xpath)[0].text
title = dom.xpath(title_xpath)[0].text.encode('utf-8')
result_url = request(title[:-16], {})['url']
# append result
results.append({'url': result_url,
'title': title})
'title': title.decode('utf-8')})
return results