Ejemplo n.º 1
0
 def test_get_custom_field_value(self):
     bridge_acc = BridgeUser(netid='javerage')
     self.assertEqual(
         get_custom_field_value(bridge_acc, BridgeCustomField.REGID_NAME),
         "")
     bridge_acc.custom_fields[BridgeCustomField.REGID_NAME] = \
         new_custom_field(BridgeCustomField.REGID_NAME, "1")
     self.assertEqual(
         get_custom_field_value(bridge_acc,
                                BridgeCustomField.STUDENT_ID_NAME), "")
     self.assertEqual(
         get_custom_field_value(bridge_acc, BridgeCustomField.REGID_NAME),
         "1")
Ejemplo n.º 2
0
 def pos_data_not_changed(self, bridge_account, hrp_wkr):
     for pos_num in range(get_total_work_positions_to_load()):
         pos_field_names = WORK_POSITION_FIELDS[pos_num]
         for i in range(len(pos_field_names)):
             bri_value = get_custom_field_value(bridge_account,
                                                pos_field_names[i])
             hrp_value = GET_POS_ATT_FUNCS[i](hrp_wkr, pos_num)
             if (hrp_value is not None and hrp_value != bri_value or
                     hrp_value is None and bri_value != ''):
                 return False
     return True
Ejemplo n.º 3
0
 def eid_not_changed(self, bridge_account, person):
     eid = get_custom_field_value(bridge_account,
                                  BridgeCustomField.EMPLOYEE_ID_NAME)
     return (person.employee_id is None and eid == '' or
             person.employee_id == eid)
Ejemplo n.º 4
0
 def sid_not_changed(self, bridge_account, person):
     sid = get_custom_field_value(bridge_account,
                                  BridgeCustomField.STUDENT_ID_NAME)
     return (person.student_number is None and sid == '' or
             person.student_number == sid)
Ejemplo n.º 5
0
 def regid_not_changed(self, bridge_account, person):
     regid = get_custom_field_value(bridge_account,
                                    BridgeCustomField.REGID_NAME)
     return person.uwregid == regid