def setUp(self):
        from flask_migrate import upgrade
        upgrade()

        # insert the users/roles
        self.admin_role = get_a_role('admin')
        self.superadmin_role = get_a_role('superadmin')
        self.admin_user = insert_a_user(email='*****@*****.**',
                                        role=self.admin_role.id)
        self.superadmin_user = insert_a_user(email='*****@*****.**',
                                             role=self.superadmin_role.id)

        # insert the companies/contracts
        company_1 = insert_a_company(name='ship', insert_contract=False)
        company_2 = insert_a_company(name='boat', insert_contract=False)
        insert_a_contract(description='vessel',
                          companies=[company_2],
                          line_items=[LineItem(description='NAVY')])
        insert_a_contract(description='sail',
                          financial_id=123,
                          companies=[company_1],
                          line_items=[LineItem(description='sunfish')])
        insert_a_contract(description='sunfish',
                          financial_id=456,
                          properties=[dict(key='foo', value='engine')])
    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(TestAdmin, self).setUp()
     self.email = '*****@*****.**'
     self.email2 = '*****@*****.**'
     self.admin_role = insert_a_role('admin')
     self.superadmin_role = insert_a_role('superadmin')
     self.admin_user = insert_a_user(email=self.email, role=self.admin_role)
     self.superadmin_user = insert_a_user(email=self.email2, role=self.superadmin_role)
示例#4
0
 def setUp(self):
     super(TestAdmin, self).setUp()
     self.email = '*****@*****.**'
     self.email2 = '*****@*****.**'
     self.admin_role = insert_a_role('admin')
     self.superadmin_role = insert_a_role('superadmin')
     self.admin_user = insert_a_user(email=self.email, role=self.admin_role)
     self.superadmin_user = insert_a_user(email=self.email2,
                                          role=self.superadmin_role)
    def setUp(self):
        from flask_migrate import upgrade
        upgrade()

        # insert the users/roles
        self.admin_role = get_a_role('admin')
        self.superadmin_role = get_a_role('superadmin')
        self.admin_user = insert_a_user(email='*****@*****.**', role=self.admin_role.id)
        self.superadmin_user = insert_a_user(email='*****@*****.**', role=self.superadmin_role.id)

        # insert the companies/contracts
        company_1 = insert_a_company(name='ship', insert_contract=False)
        company_2 = insert_a_company(name='boat', insert_contract=False)
        insert_a_contract(description='vessel', companies=[company_2], line_items=[LineItem(description='NAVY')])
        insert_a_contract(description='sail', financial_id=123, companies=[company_1], line_items=[LineItem(description='sunfish')])
        insert_a_contract(description='sunfish', financial_id=456, properties=[dict(key='foo', value='engine')])
示例#6
0
    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(TestUserAuth, self).setUp()
     self.email = "*****@*****.**"
     insert_a_user(email=self.email)
示例#8
0
 def setUp(self):
     super(TestUserAuth, self).setUp()
     self.email = '*****@*****.**'
     insert_a_user(email=self.email)
示例#9
0
 def setUp(self):
     super(TestSherpa, self).setUp()
     self.email = '*****@*****.**'
     self.user = insert_a_user(email=self.email)
 def setUp(self):
     super(TestSherpa, self).setUp()
     self.email = '*****@*****.**'
     self.user = insert_a_user(email=self.email)