def setUp(self): self.candidate_tag = CandidateTagsManage() self.sys_tag = SystemTagsManage() self.job_manage = JobStatusManage() self.resume_doc = resume_doc resume, _ = PinbotResumeUtils.save(resume_doc) self.resume = resume self.resume_id = str(resume.id)
def post(self, request): resume_id = request.POST['resume_id'] tag_names = request.POST.getlist('tag_names[]') tag_ids = request.POST.getlist('tag_ids[]') ctm = CandidateTagsManage() ctm.add_tag( tag_names=tag_names, tag_ids=tag_ids, resume_id=resume_id ) result = { 'status': 'ok' } return JsonResponse(result)
def setUp(self): self.candidate_tag = CandidateTagsManage() self.sys_tag = SystemTagsManage() self.job_manage = JobStatusManage() self.resume_doc = resume_doc resume, _ = PinbotResumeUtils.save(resume_doc) self.resume = resume self.resume_id = str(resume.id)
class TestCandidateDetailsRuntime(TestCase): fixtures = [ 'user.json', 'resumebuyrecord.json', 'downloadresumemark.json', 'resumemarksetting.json', 'sendcompanycard.json', 'job.json', 'company.json', 'contactinfodata.json', 'candidatetag.json', 'candidate.json', ] def setUp(self): self.candidate_tag = CandidateTagsManage() self.sys_tag = SystemTagsManage() self.job_manage = JobStatusManage() self.resume_doc = resume_doc resume, _ = PinbotResumeUtils.save(resume_doc) self.resume = resume self.resume_id = str(resume.id) def tearDown(self): ResumeData.objects.filter(id=self.resume.id).delete() ContactInfoData.objects.filter(resume_id=self.resume_id).delete() def test_add_candidate_tag(self): ret = self.candidate_tag.add_tag( resume_id=self.resume_id, tag_ids=[1, 2, 3, 4], tag_names=['tag1', 'tag2', 'tag3', 'tag4'] ) self.assertTrue(ret) def test_get_candidate_info(self): ret = CandidateDetailsManage.get_resume_info( resume_id=self.resume_id ) self.assertIsNotNone(ret, None) def get_candidate_tag(self): ret = self.candidate_tag.get_tags(self.resume_id) self.assertIsNotNone(ret, None) def test_del_candidate_tag(self): ret = self.candidate_tag.del_tag( resume_id=self.resume_id, tag_ids=[1, 2, 3, 4], tag_names=['tag1', 'tag2', 'tag3', 'tag4'] ) self.assertTrue(ret) def test_add_sys_tag(self): ret = self.sys_tag.add_tag( name='tag5' ) self.assertTrue(ret) def test_get_sys_tags(self): ret = self.sys_tag.get_tags() self.assertIsNotNone(ret, None) def test_update_job_status(self): ret = self.job_manage.update_status( resume_id=self.resume_id, job_status='求职(已离职)' ) self.assertTrue(ret)
class TestCandidateDetailsRuntime(TestCase): fixtures = [ 'user.json', 'resumebuyrecord.json', 'downloadresumemark.json', 'resumemarksetting.json', 'sendcompanycard.json', 'job.json', 'company.json', 'contactinfodata.json', 'candidatetag.json', 'candidate.json', ] def setUp(self): self.candidate_tag = CandidateTagsManage() self.sys_tag = SystemTagsManage() self.job_manage = JobStatusManage() self.resume_doc = resume_doc resume, _ = PinbotResumeUtils.save(resume_doc) self.resume = resume self.resume_id = str(resume.id) def tearDown(self): ResumeData.objects.filter(id=self.resume.id).delete() ContactInfoData.objects.filter(resume_id=self.resume_id).delete() def test_add_candidate_tag(self): ret = self.candidate_tag.add_tag( resume_id=self.resume_id, tag_ids=[1, 2, 3, 4], tag_names=['tag1', 'tag2', 'tag3', 'tag4']) self.assertTrue(ret) def test_get_candidate_info(self): ret = CandidateDetailsManage.get_resume_info(resume_id=self.resume_id) self.assertIsNotNone(ret, None) def get_candidate_tag(self): ret = self.candidate_tag.get_tags(self.resume_id) self.assertIsNotNone(ret, None) def test_del_candidate_tag(self): ret = self.candidate_tag.del_tag( resume_id=self.resume_id, tag_ids=[1, 2, 3, 4], tag_names=['tag1', 'tag2', 'tag3', 'tag4']) self.assertTrue(ret) def test_add_sys_tag(self): ret = self.sys_tag.add_tag(name='tag5') self.assertTrue(ret) def test_get_sys_tags(self): ret = self.sys_tag.get_tags() self.assertIsNotNone(ret, None) def test_update_job_status(self): ret = self.job_manage.update_status(resume_id=self.resume_id, job_status='求职(已离职)') self.assertTrue(ret)
def get(self, request, resume_id): resume_query = CandidateDetailsManage.get_resume_info(str(resume_id)) if not resume_query: raise Http404 contract_query = ContactInfoData.objects.prefetch_related( 'candidate__candidate_remarks', 'candidate__candidate_remarks__admin', 'candidate__send_records', 'candidate__send_records__operator', 'candidate__send_records__job', 'candidate__send_records__job__user', ).filter(resume_id=str(resume_id)) if not contract_query: raise Http404 # 获取联系人信息 contract_info = contract_query[0] # 获取简历信息 resume_info = self.get_resume_info( resume_query=resume_query, contract_name=contract_info.name ) candidate_info = self.get_candidate(contract_info.id) # 获取候选人标签信息 ctm = CandidateTagsManage() candidate_tags = ctm.get_tags(str(resume_id)) # 获取系统标签列表 sys_tags = SystemTagsManage.get_tags() # 获取候选人举报信息记录 feedbacks = UserResumeFeedback.objects.filter( resume_id=str(resume_id) ) # 获取候选人推荐历史 feed_results_list = self.get_feed_hitstory(resume_id=resume_id) # 未发布的推荐数据 reco_feed_results = self.get_reco_feed_results(resume_id) # 简历下载记录 download_records = self.get_download_records(resume_id) return render( request, self.template_name, { 'contract': contract_info, 'resume_info': resume_info, 'feedbacks': feedbacks, 'feed_results_list': feed_results_list, 'sys_tags': sys_tags, 'candidate_tags': candidate_tags, 'candidate_tag_name_list': [tag.name for tag in candidate_tags], 'candidate_info': candidate_info, 'reco_feed_results': reco_feed_results, 'download_records': download_records, } )