def test_count(db_connection): create_job('1', approved_at=date(1987, 8, 30)) create_job('2', approved_at=None) create_job('3', approved_at=date(1987, 8, 30)) create_job('4', approved_at=date(1987, 8, 30), expires_at=date(1987, 9, 1)) assert Job.count() == 2
def index(): with db: jobs_count = Job.count() companies_count = Job.companies_count() return render_template('index.html', jobs_count=jobs_count, companies_count=companies_count, stories=Story.listing())
def candidate(): with db: jobs_count = Job.count() companies_count = Job.companies_count() return render_template( 'candidate.html', jobs_count=jobs_count, companies_count=companies_count, thumbnail=thumbnail(title='Příručka hledání první práce v\u00a0IT'))
def job(job_id): with db: job = Job.get_by_id(job_id) or abort(404) jobs_count = Job.count() companies_count = Job.companies_count() return render_template('job.html', job=job, jobs_count=jobs_count, companies_count=companies_count, thumbnail=thumbnail(job_title=job.title, job_company=job.company_name, job_location=job.location))
def jobs(): with db: jobs = Job.listing() jobs_count = Job.count() companies_count = Job.companies_count() jobs_bot = Job.bot_listing() return render_template( 'jobs.html', jobs=jobs, jobs_count=jobs_count, companies_count=companies_count, jobs_bot=jobs_bot, thumbnail=thumbnail(title='Práce v\u00a0IT pro začátečníky'))
def jobs(): with db: jobs = Job.listing() jobs_count = Job.count() companies_count = Job.companies_count() jobs_bot = Job.bot_listing() return render_template( 'jobs.html', jobs=jobs, jobs_count=jobs_count, companies_count=companies_count, jobs_bot=jobs_bot, thumbnail=thumbnail(title='Práce pro začínající programátory'))
def test_count_takes_only_approved_jobs(db): create_job('1', is_approved=True) create_job('2', is_approved=False) create_job('3', is_approved=True) assert Job.count() == 2