def test_get_word_and_translation(self): for id in insert_words(*'abcd'): w, t = q.get_word_and_translation(id) self.assertEqual(w, t) # insert words works this way self.assertEqual(q.get_word_id(w), id)
def insert_words(*words): for word in words: q.add_word(word, word) yield q.get_word_id(word)