def test_location(locations, expected): job = Job(**prepare_job_data('1', locations=locations)) assert job.location == expected
def test_location_with_remote(locations, remote, expected): job = Job(**prepare_job_data('1', locations=locations, remote=remote)) assert job.location == expected
def test_tags_remote(remote, expected): job = Job(**prepare_job_data('1', remote=remote)) tags = job.tags() assert ('REMOTE' in tags) is expected
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
def test_is_highlighted(pricing_plan, expected): job = Job(**prepare_job_data('1', pricing_plan=pricing_plan)) assert job.is_highlighted is expected
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
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
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
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
def test_is_juniorguru_false(): job = Job(**prepare_job_data('1', source='abcxyz')) assert job.is_juniorguru is False
def test_is_juniorguru_true(): job = Job(**prepare_job_data('1', source='juniorguru')) assert job.is_juniorguru is True