def test_by_assignment_role_principal_signer(self): from nexus.models import Title, Role, Employee self._office(id=1, name='Mir') self._employee(id=1, title=Title.SENIOR_ASSOCIATE) self._employee(id=2, title=Title.PRINCIPAL) self._employee(id=3, title=Title.DIRECTOR_RESEARCH) self._employee(id=4, title=Title.PRINCIPAL) qs = Employee.by_assignment_role(Role.PRINCIPAL_SIGNER) self.assertItemsEqual([e.id for e in qs], [2, 4])
def test_by_assignment_role_signer(self): self._office(id=1, name='Mir') self._employee(id=1, is_certified_general=True) self._employee(id=2, is_certified_general=True) self._employee(id=3, is_certified_general=False) self._employee(id=4, is_certified_general=True) from nexus.models import Role, Employee qs = Employee.by_assignment_role(Role.SIGNER) self.assertItemsEqual([e.id for e in qs], [1, 2, 4])
def test_by_assignment_role_reviewer(self): self._office(id=1, name='Mir') self._employee(id=1, is_reviewer=False) self._employee(id=2, is_reviewer=True) self._employee(id=3, is_reviewer=False) self._employee(id=4, is_reviewer=True) from nexus.models import Role, Employee qs = Employee.by_assignment_role(Role.REVIEWER) self.assertItemsEqual([e.id for e in qs], [2, 4])
def test_by_assignment_role_appraiser(self): from nexus.models import Title, Role, Employee self._office(id=1, name='Mir') self._employee(id=1, title=Title.SENIOR_ASSOCIATE) self._employee(id=2, title=Title.INTERN) self._employee(id=3, title=Title.DIRECTOR_RESEARCH) self._employee(id=4, title=Title.DIRECTOR) qs = Employee.by_assignment_role(Role.APPRAISER) self.assertItemsEqual([e.id for e in qs], [1, 4])
def test_by_assignment_role_inspector(self): self._office(id=1, name='Mir') self._employee(id=1, is_inspector=False) self._employee(id=2, is_inspector=True) self._employee(id=3, is_inspector=True) self._employee(id=4, is_inspector=False) from nexus.models import Role, Employee qs = Employee.by_assignment_role(Role.INSPECTOR) self.assertItemsEqual([e.id for e in qs], [2, 3])
def test_by_assignment_role_researcher(self): from nexus.models import Title, Role, Employee self._office(id=1, name='Mir') self._employee(id=1, title=Title.SENIOR_ASSOCIATE) self._employee(id=2, title=Title.PRINCIPAL) self._employee(id=3, title=Title.DIRECTOR_RESEARCH) self._employee(id=4, title=Title.INTERN_RESEARCH) self._employee(id=5, title=Title.INTERN) qs = Employee.by_assignment_role(Role.RESEARCHER) self.assertItemsEqual([e.id for e in qs], [3, 4])
def test_by_assignment_role_procurer(self): from nexus.models import Role, Title, Employee self._office(id=1, name='Mir') self._employee(id=1, is_procuring_agent=True) self._employee(id=2, is_procuring_agent=False) self._employee(id=3, is_procuring_agent=True) self._employee(id=4, is_procuring_agent=True, title=Title.PRINCIPAL) self._employee(id=5, is_procuring_agent=True) qs = Employee.by_assignment_role(Role.PROCURER) self.assertItemsEqual([e.id for e in qs], [1, 3, 5])