예제 #1
0
def test_location(locations, expected):
    job = Job(**prepare_job_data('1', locations=locations))

    assert job.location == expected
예제 #2
0
def test_location_with_remote(locations, remote, expected):
    job = Job(**prepare_job_data('1', locations=locations, remote=remote))

    assert job.location == expected
예제 #3
0
def test_tags_remote(remote, expected):
    job = Job(**prepare_job_data('1', remote=remote))
    tags = job.tags()

    assert ('REMOTE' in tags) is expected
예제 #4
0
def test_tags_employment_types(employment_types, expected):
    job = Job(**prepare_job_data('1', employment_types=employment_types))
    tags = set(job.tags())

    assert expected == tags
예제 #5
0
def test_is_highlighted(pricing_plan, expected):
    job = Job(**prepare_job_data('1', pricing_plan=pricing_plan))

    assert job.is_highlighted is expected
예제 #6
0
def test_tags_new(posted_at, expected):
    job = Job(**prepare_job_data('1', posted_at=posted_at))
    tags = job.tags(today=date(2020, 9, 28))

    assert ('NEW' in tags) is expected
예제 #7
0
def test_expires_soon(today, expected):
    job = Job(**prepare_job_data('1', expires_at=date(2020, 7, 1)))

    assert job.expires_soon(today=today) is expected
예제 #8
0
def test_days_until_expires():
    job = Job(**prepare_job_data('1', expires_at=date(1987, 9, 8)))

    assert job.days_until_expires(today=date(1987, 8, 30)) == 9
예제 #9
0
def test_days_since_posted():
    job = Job(**prepare_job_data('1', posted_at=date(1987, 8, 30)))

    assert job.days_since_posted(today=date(1987, 9, 8)) == 9
예제 #10
0
def test_is_juniorguru_false():
    job = Job(**prepare_job_data('1', source='abcxyz'))

    assert job.is_juniorguru is False
예제 #11
0
def test_is_juniorguru_true():
    job = Job(**prepare_job_data('1', source='juniorguru'))

    assert job.is_juniorguru is True