Fakultas Ilmu Komputer UI

Commit cf25c39e authored by Joshua Casey's avatar Joshua Casey
Browse files

revised test

parent 5c921954
...@@ -24,7 +24,7 @@ class ApplicationTests(APITestCase): ...@@ -24,7 +24,7 @@ class ApplicationTests(APITestCase):
response = self.client.post(url, {'username': 'dummy.mahasiswa', 'password': 'lalala', 'login-type': 'sso-ui'}, format='json') response = self.client.post(url, {'username': 'dummy.mahasiswa', 'password': 'lalala', 'login-type': 'sso-ui'}, format='json')
student_id = response.data.get('student').get('id') student_id = response.data.get('student').get('id')
url = '/api/students/' + str(student_id) + '/applications/' url = '/api/students/' + str(student_id) + '/applied-vacancies/'
response = self.client.get(url) response = self.client.get(url)
self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.status_code, status.HTTP_200_OK)
...@@ -51,11 +51,11 @@ class ApplicationTests(APITestCase): ...@@ -51,11 +51,11 @@ class ApplicationTests(APITestCase):
new_company = Company.objects.create(user=new_user, description="lalala",verified=True,logo=None,address=None) new_company = Company.objects.create(user=new_user, description="lalala",verified=True,logo=None,address=None)
new_vacancy = Vacancy.objects.create(company=new_company, verified=True, open_time=datetime.fromtimestamp(0), description="lalala", close_time=datetime.today()) new_vacancy = Vacancy.objects.create(company=new_company, verified=True, open_time=datetime.fromtimestamp(0), description="lalala", close_time=datetime.today())
url = '/api/students/' + str(student_id) + '/applications/' url = '/api/students/' + str(student_id) + '/applied-vacancies/'
response = self.client.post(url, {'vacancy_id' : new_vacancy.pk, 'cover_letter' : 'this is a cover letter.'}, format='json') response = self.client.post(url, {'vacancy_id' : new_vacancy.pk, 'cover_letter' : 'this is a cover letter.'}, format='json')
self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.status_code, status.HTTP_200_OK)
url = '/api/students/' + str(student_id) + '/applications/' + str(new_vacancy.pk) + '/' url = '/api/students/' + str(student_id) + '/applied-vacancies/' + str(new_vacancy.pk) + '/'
response = self.client.delete(url) response = self.client.delete(url)
self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.status_code, status.HTTP_200_OK)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment