Fakultas Ilmu Komputer UI

Commit 50b7c7cb authored by M. Reza Qorib's avatar M. Reza Qorib
Browse files

Merge branch 'UserStory2' of https://gitlab.com/PPL2017csui/PPLA1 into UserStory2

parents 753c45a1 507fc223
......@@ -82,7 +82,7 @@ class RegisterTests(APITestCase):
def test_create_and_recreate(self):
url = '/api/register/'
tc_post = {'username': 'dummy.company', 'password': 'corporatepass', 'name':'tutuplapak', 'description':'menutup lapak', 'email': 'email@email.com'}
tc_post = {'password': 'corporatepass', 'name':'tutuplapak', 'description':'menutup lapak', 'email': 'email@email.com', 'logo':'lalala', 'address':'alamat'}
response = self.client.post(url, tc_post, format='multipart')
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
......
......@@ -52,7 +52,7 @@ class ApplicationTests(APITestCase):
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/'
response = self.client.post(url, {'vacancy_id' : new_vacancy.pk}, 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)
url = '/api/students/' + str(student_id) + '/applications/' + str(new_vacancy.pk) + '/'
......
......@@ -198,6 +198,7 @@ class CompanyRegisterViewSet(viewsets.GenericViewSet):
user.save()
company.save()
serializer = self.serializer_class(user, context={'request': request})
login(request, user)
return Response(serializer.data, status=status.HTTP_201_CREATED)
else:
return Response({'error': 'Company with email '+data['email']+' already exist'}, status=HTTP_409_CONFLICT)
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