示例#1
0
 def add(cls,
         id,
         company_id,
         city_id,
         title,
         work_year='',
         department='',
         salary='',
         education='',
         description='',
         advantage='',
         job_nature='',
         created_at=0):
     JobModel.add(id=id,
                  title=title,
                  city_id=city_id,
                  company_id=company_id,
                  work_year=work_year,
                  department=department,
                  salary=salary,
                  education=education,
                  description=description,
                  advantage=advantage,
                  job_nature=job_nature,
                  created_at=created_at)
示例#2
0
 def test_add_job(self):
     data = {
         'id': 1001,
         'title': '招聘绅士hentai',
         'work_year': 3,
         'city_id': 2,
         'company_id': 11,
         'department': '二次元部门',
         'salary': '60k-100k',
         'education': 2,
         'description': '这是JD这是JD这是JD这是JD这是JD这是JD',
         'advantage': '有妹子',
         'job_nature': 2,
         'created_at': 1494957220,
     }
     JobModel.add(**data)
     jobs = JobModel.list()
     self.assertEqual(len(jobs), 3)
     job = JobModel.get(job_id=1001)
     for (key, value) in data.items():
         self.assertEqual(getattr(job, key), value)
示例#3
0
 def test_get_job(self):
     job = JobModel.get(job_id=6814)
     self.assertEqual(job.id, 6814)
     self.assertEqual(job.title, 'web前端')
示例#4
0
 def test_count_job(self):
     count = JobModel.count()
     self.assertEqual(count, 2)
     count = JobModel.count(keyword_id=100)
     self.assertEqual(count, 2)
示例#5
0
 def test_list_job(self):
     jobs = JobModel.list()
     self.assertEqual(len(jobs), 2)
     jobs = JobModel.list(keyword_id=100)
     self.assertEqual(len(jobs), 2)
示例#6
0
 def list(cls, keyword_id=None, limit=None, offset=None):
     return JobModel.list(keyword_id=keyword_id, limit=limit, offset=offset)
示例#7
0
 def count(cls, id=None, keyword_id=None):
     return JobModel.count(id=id, keyword_id=keyword_id)