def testContractExtendWithPayment(self):
		'''Test that Contract valid_till dates are extended according to the quantum paid, eg. extended 3 months for 3 months paid'''
		# Get the baseline valid_till month
		bmonth = self.c.valid_till.month

		# Let's make a Payment
		QUANTUM = 3
		amt = QUANTUM * self.c.tier.fee
		p = Payment(date_paid=datetime.datetime(2010, 11, 16), amount=amt, contract=self.c, user=self.u)
		p.save()

		# Check the new valid_till month
		nmonth = self.c.valid_till.month

		self.assertEqual(nmonth-bmonth, QUANTUM)
dataset/ETHPy150Open hackerspacesg/hackdo/hado/tests.py/ContractTest.testContractExtendWithPayment/original