def import_from_adzuna(self, job_area, count): """ Method to import jobs from the Adzuna API """ locations = job_area.locations args = list(locations) + [count] az = Adzuna() all_jobs = az.jobs_at_location(*args) for job in all_jobs: obj, created = JobAdvert.get_or_create_from_adzuna(job_area, job) if not created: break
def test_jobs_at_location(self): az = Adzuna() x = az.jobs_at_location('UK', 'London', 'South East London', 15) self.assertEqual(len(list(x)), 15)