def test_create_milestones(self): self.prepare_mocked_contract() manager = CeasefireMilestoneManager(Mock()) self.contract.dateSigned = datetime.now() manager.create_milestones(self.mocked_request) self.assertEqual(len(self.contract.milestones), 3, 'milestones were not created')
def change_contract(self, request): new_status = request.validated['data'].get('status') if new_status == 'active.payment': milestone_manager = CeasefireMilestoneManager(request.context) milestone_manager.create_milestones(request)