Exemplo n.º 1
0
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
Exemplo n.º 2
0
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())
Exemplo n.º 3
0
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'))
Exemplo n.º 4
0
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))
Exemplo n.º 5
0
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'))
Exemplo n.º 6
0
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'))
Exemplo n.º 7
0
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