Exemplo n.º 1
0
	def test_saving_interest(self):
	
		first_interest = Interest()
		first_interest.interest = 'Testing'
		first_interest.save()
		
		second_interest = Interest()
		second_interest.interest = 'Second testing'
		second_interest.save()
		
		saved_interests = Interest.objects.all()
		self.assertEqual(2, saved_interests.count())
		
		first_saved_interest = saved_interests[0]
		second_saved_interest = saved_interests[1]
		
		self.assertEqual(first_saved_interest.interest, 'Testing')
		self.assertEqual(second_saved_interest.interest, 'Second testing')
Exemplo n.º 2
0
	def test_can_you_get_to_edit_interest_after_created_one(self):
		first_interest = Interest()
		first_interest.interest = 'Testing'
		first_interest.save()
		response = self.client.get('/cv/interests/edit/1/')
		self.assertTemplateUsed(response, 'cv/interest_edit.html')