def tweet(response, dry_run=True): bot = JLPTBot() msg = bot.format(bot.get_date_based_word()) if not dry_run: bot.tweet(msg) response.headers['Content-Type'] = 'text/plain' response.write(msg)
def test_format_spaces_commas(self): bot = JLPTBot() word = { u'hiragana': u'\u30c1\u30e3\u30f3\u30b9', u'english': u'chance,opportunity', } self.assertEqual(bot.format(word), u'\u30c1\u30e3\u30f3\u30b9\nchance, opportunity')
def test_format_kanji(self): bot = JLPTBot() word = { u'kanji': u'\u773a\u3081', u'hiragana': u'\u306a\u304c\u3081', u'english': u'scene,view,prospect,outlook', } self.assertEqual(bot.format(word), u'\u773a\u3081 - \u306a\u304c\u3081\nscene, view, prospect, outlook')
def test_format_kanji(self): bot = JLPTBot() word = { u'kanji': u'\u773a\u3081', u'hiragana': u'\u306a\u304c\u3081', u'english': u'scene,view,prospect,outlook', } self.assertEqual( bot.format(word), u'\u773a\u3081 - \u306a\u304c\u3081\nscene, view, prospect, outlook' )