def test_non_department_employer_cannot_view_application(self): other_department = create_department(test_user_data["departments"][1]) create_employer(other_department, test_user_data["employers"][1]) self.client.login( email=test_user_data["employers"][1]["email"], password=test_user_data["employers"][1]["password"], ) response = self.client.get( reverse("applications:application_details", kwargs={"pk": self.app.id}) ) self.assertContains( response, "You do not have the right permissions to view this page" )
def test_employer_already_registered_redirect_to_index(self): create_employer(self.department, test_user_data["employer"]) self.client.login( email=test_user_data["employer"]["email"], password=test_user_data["employer"]["password"], ) response = self.client.get(reverse("register:employer_register")) self.assertRedirects( response, expected_url=reverse("uplyft:index"), status_code=302, target_status_code=302, fetch_redirect_response=True, )
def setUp(self): self.department = create_department_with_profile(test_user_data["department"]) self.employer = create_employer(self.department, test_user_data["employer"]) self.candidate = create_candidate_with_active_profile( test_user_data["candidate"] ) self.other_candidates = [] for test_candidate in test_user_data["candidates"]: self.other_candidates.append( create_candidate_with_active_profile(test_candidate) ) self.job1 = create_job(self.department, test_user_data["job_details"][0]) self.apps = [] for other_candidate in self.other_candidates: self.apps.append( create_application( self.job1, other_candidate, other_candidate.candidate_profile ) ) self.job2 = create_job(self.department, test_user_data["job_details"][1]) self.apps.append( create_application( self.job2, self.other_candidates[0], self.other_candidates[0].candidate_profile, ) )
def setUp(self): self.department = create_department(test_user_data["department"]) self.employer = create_employer(self.department, test_user_data["employer"]) self.user = self.employer.user self.inactive_user = create_user(test_user_data["candidate"], False, False)
def setUp(self): self.candidate = create_candidate_with_active_profile( test_user_data["candidate"]) self.department = create_department(test_user_data["department"]) self.employer = create_employer(self.department, test_user_data["employer"]) self.job = create_job(self.department, test_user_data["job_details"][0]) self.profile = create_profile(test_user_data["candidate"]["profile"])
def test_email_already_taken_form_invalid(self): employer = create_employer(self.department, test_user_data["employer"]) form = EmployerRegistrationForm( data={ "first_name": test_user_data["employers"][1]["first_name"], "last_name": test_user_data["employers"][1]["last_name"], "email": employer.user.email, "password1": test_user_data["employers"][1]["password"], "password2": test_user_data["employers"][1]["password"], "department": self.job.department.id, } ) self.assertFalse(form.is_valid())
def test_view_contains_profile_data_if_exists(self): self.department_with_profile = create_department_with_profile( test_user_data["department"]) self.employer_with_department_profile = create_employer( self.department_with_profile, test_user_data["candidate"]) self.login(test_user_data["candidate"]) response = self.client.get( reverse("department_profile:update_department_profile")) self.assertContains(response, "Description") self.assertContains(response, "Website") self.assertContains(response, "Address") self.assertContains( response, self.department_with_profile.department_profile.description) self.assertContains( response, self.department_with_profile.department_profile.website) self.assertContains( response, self.department_with_profile.department_profile.address)
def setUp(self): self.department = create_department(test_user_data["department"]) self.employer = create_employer(self.department, test_user_data["employer"]) self.browser = webdriver.Firefox() self.browser.implicitly_wait(10)
def setUp(self): self.department = create_department( test_user_data["department_with_no_profile"]) self.employer = create_employer(self.department, test_user_data["employer"])