def test_saving_and_retreiving_phrases(self): qna_set = Set() qna_set.name = "QnA" qna_set.save() first_phrase = Phrase() first_phrase.url = "http://www.stackoverflow.com" first_phrase.english = "I have a question" first_phrase.korean = "질문이 있어요" first_phrase.set = qna_set first_phrase.save() saved_phrases = Phrase.objects.all() self.assertEqual(saved_phrases.count(), 1) saved_phrase = saved_phrases[0] self.assertEqual(saved_phrase.english, "I have a question")
def test_saving_and_retreiving_player_record(self): qna_set = Set() qna_set.name = "QnA" qna_set.save() phrase = Phrase() phrase.url = "http://www.stackoverflow.com" phrase.english = "I have a question" phrase.korean = "질문이 있어요" phrase.set = qna_set phrase.save() player_record = PlayerRecord() player_record.phrase = phrase player_record.answer = "I have question" player_record.save() saved_player_records = PlayerRecord.objects.all() self.assertEqual(saved_player_records.count(), 1) saved_player_record = saved_player_records[0] self.assertEqual(saved_player_record.answer, "I have question")