Esempio n. 1
0
	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)
Esempio n. 2
0
	def _createTestChoice(self, uniqueId, votes, poll):
		choice = Choice(uniqueId = uniqueId, votes = votes, poll = poll)
		choice.save()
		
		return choice