diff --git a/uw_hrp/__init__.py b/uw_hrp/__init__.py index f45a172..a6799a3 100644 --- a/uw_hrp/__init__.py +++ b/uw_hrp/__init__.py @@ -2,8 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 """ -This is the interface for interacting with -the hrp web service. +This is the interface for interacting with the hrp web service. """ import logging @@ -16,10 +15,6 @@ def get_resource(url): response = HRP_DAO().getURL(url, {'Accept': 'application/json'}) - - logger.debug("{0} ==status==> {1}".format(url, response.status)) if response.status != 200: raise DataFailureException(url, response.status, response.data) - - logger.debug("{0} ==data==> {1}".format(url, response.data)) return response.data diff --git a/uw_hrp/models.py b/uw_hrp/models.py index ad033f3..b9a5944 100644 --- a/uw_hrp/models.py +++ b/uw_hrp/models.py @@ -122,7 +122,7 @@ def to_json(self): 'budget_code': self.budget_code, 'end_date': date_to_str(self.end_date), 'is_primary': self.is_primary, - 'job_title': self.title, + 'job_title': self.job_title, 'job_class': self.job_class, 'location': self.location, 'org_code': self.org_code, @@ -147,7 +147,7 @@ def __init__(self, *args, **kwargs): if data is None: return super(EmploymentDetails, self).__init__(*args, **kwargs) - self.title = data.get("BusinessTitle") + self.job_title = data.get("BusinessTitle") self.job_profile = JobProfile(data=data.get("JobProfile")) self.job_class = get_emp_program_job_class( diff --git a/uw_hrp/tests/test_models.py b/uw_hrp/tests/test_models.py index 8d78034..4835228 100644 --- a/uw_hrp/tests/test_models.py +++ b/uw_hrp/tests/test_models.py @@ -96,18 +96,23 @@ def test_employment_status(self): def test_job_profile(self): job_prof = JobProfile(job_code="1", description="A") self.assertIsNotNone(job_prof) - job_prof = JobProfile( - data={ + self.assertEqual(JobProfile( + data={"Name": "Unpaid", "IDs": []}).to_json(), + { + 'job_code': None, 'description': 'Unpaid' + } + ) + + job_prof = JobProfile(data={ "Name": "Unpaid Academic", - "WID": "d957207a306801fc5c30a8906f5c6b57", "IDs": [ - { - "Type": "WID", - "Value": "d957207a306801fc5c30a8906f5c6b57" - }, { "Type": "Job_Profile_ID", "Value": "21184" + }, + { + "Type": "WID", + "Value": "d957207a306801fc5c30a8906f5c6b57" } ] } @@ -369,7 +374,7 @@ def test_worker(self): 'status': 'Active', 'termination_date': None }, - 'primary_job_title': None, + 'primary_job_title': 'Student Assistant (NE H)', 'primary_manager_id': None, 'worker_wid': '1b68136df25201c0710e3ddad462fa1d' }