def test_delete_flow(self): flow = insert_a_flow(stage_ids=self.stage_ids) self.assertEquals(Flow.query.count(), 1) delete_flow(flow.id) self.assertEquals(Flow.query.count(), 0) self.assertEquals(Stage.query.count(), 2)
def setUp(self): super(TestConductor, self).setUp() # create a conductor and general staff person self.conductor_role_id = insert_a_role('conductor') self.staff_role_id = insert_a_role('staff') self.conductor = insert_a_user(role=self.conductor_role_id) self.staff = insert_a_user(email='*****@*****.**', role=self.staff_role_id) # create three stages, and set up a flow between them self.stage1 = insert_a_stage(name='stage1', send_notifs=True, post_opportunities=True) self.stage2 = insert_a_stage(name='stage2', send_notifs=True, post_opportunities=False) self.stage3 = insert_a_stage(name='stage3', send_notifs=False, post_opportunities=False) self.flow = insert_a_flow(stage_ids=[self.stage1.id, self.stage2.id, self.stage3.id]) # create two contracts self.contract1 = insert_a_contract( contract_type='County', description='scuba supplies', financial_id=123, properties=[{'key': 'Spec Number', 'value': '123'}] ) self.contract2 = insert_a_contract( contract_type='County', description='scuba repair', financial_id=456, properties=[{'key': 'Spec Number', 'value': '456'}] ) self.login_user(self.conductor) self.detail_view = '/conductor/contract/{}/stage/{}'
def setUp(self): super(TestConductor, self).setUp() # create a conductor and general staff person self.conductor_role_id = insert_a_role('conductor') self.staff_role_id = insert_a_role('staff') self.conductor = insert_a_user(role=self.conductor_role_id) self.staff = insert_a_user(email='*****@*****.**', role=self.staff_role_id) # create three stages, and set up a flow between them self.stage1 = insert_a_stage(name='stage1', send_notifs=True, post_opportunities=True) self.stage2 = insert_a_stage(name='stage2', send_notifs=True, post_opportunities=False) self.stage3 = insert_a_stage(name='stage3', send_notifs=False, post_opportunities=False) self.flow = insert_a_flow( stage_ids=[self.stage1.id, self.stage2.id, self.stage3.id]) # create two contracts self.contract1 = insert_a_contract(contract_type='County', description='scuba supplies', financial_id=123, properties=[{ 'key': 'Spec Number', 'value': '123' }]) self.contract2 = insert_a_contract(contract_type='County', description='scuba repair', financial_id=456, properties=[{ 'key': 'Spec Number', 'value': '456' }]) self.login_user(self.conductor) self.detail_view = '/conductor/contract/{}/stage/{}'
def test_get_all_flows(self): insert_a_flow(name='one') insert_a_flow(name='two') insert_a_flow(name='three') self.assertEquals(len(get_all_flows()), 3)
def test_update_flow(self): flow = insert_a_flow(stage_ids=self.stage_ids) self.assertEquals(Flow.query.first().flow_name, flow.flow_name) update_flow(flow.id, {'flow_name': 'updated'}) self.assertEquals(Flow.query.first().flow_name, 'updated')