def job(job_id): with db: metrics = dict(**Metric.as_dict(), **Job.aggregate_metrics()) job = Job.juniorguru_get_by_id(job_id) return render_template('job.html', nav_active='jobs', subnav_tabs=JOBS_SUBNAV_TABS, subnav_active='jobs', job=job, metrics=metrics, thumbnail=thumbnail(job_title=job.title, job_company=job.company_name, job_location=job.location))
def test_juniorguru_get_by_id_raises_dost_not_exist_error(db_connection): create_job('1', source='remoteok') with pytest.raises(Job.DoesNotExist): assert Job.juniorguru_get_by_id('1')
def test_juniorguru_get_by_id(db_connection): job = create_job('1', source='juniorguru') assert Job.juniorguru_get_by_id('1') == job