def test_when_retrieving_choice_by_unique_id_then_the_correct_choice_is_returned(self): uniqueId = self.getUniqueId() choice = Choice() poll = Poll() poll.save() choice.poll = poll choice.uniqueId = uniqueId choice.save(); result = self.sut.getChoiceByUniqueId(uniqueId) self.assertEqual(choice.id, result.id)
def _createTestChoice(self, uniqueId, votes, poll): choice = Choice(uniqueId = uniqueId, votes = votes, poll = poll) choice.save() return choice