Fakultas Ilmu Komputer UI

Commit 7d064006 authored by Zamil Majdy's avatar Zamil Majdy
Browse files

[#140818877] [#39] [Red] testcase change verified to status on company entity

parent 7fd557ba
......@@ -4,8 +4,8 @@ from rest_framework.test import APIClient, APITestCase
from django.contrib.auth.models import User
from core.models.accounts import Company, Supervisor, Student
class LoginTests(APITestCase):
class LoginTests(APITestCase):
@requests_mock.Mocker()
def test_succesful_student_login_relogin(self, m):
m.post('https://api.cs.ui.ac.id/authentication/ldap/v2/', json={
......@@ -68,7 +68,7 @@ class LoginTests(APITestCase):
def test_success_company_login(self):
new_user = User.objects.create_user('dummy.login.company', 'dummy.login.company@company.com', 'lalala123')
new_company = Company.objects.create(user=new_user, description="lalalala", verified=True, logo=None, address=None)
new_company = Company.objects.create(user=new_user, description="lalalala", status=Company.VERIFIED, logo=None, address=None)
url = '/api/login/'
response = self.client.post(url, {'username': 'dummy.login.company', 'password': 'lalala123', 'login-type': 'company'}, format='json')
......@@ -101,6 +101,7 @@ class RegisterTests(APITestCase):
response = self.client.post(url, {'username': 'lalala'}, format='multipart')
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
class ProfileUpdateTests(APITestCase):
@requests_mock.Mocker()
......
......@@ -65,7 +65,7 @@ class ApplicationTests(APITestCase):
student_id = response.data.get('student').get('id')
new_user = User.objects.create_user('dummy.company', 'dummy.company@company.com', 'lalala123')
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",status=Company.VERIFIED,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())
url = '/api/students/' + str(student_id) + '/applied-vacancies/'
......@@ -133,7 +133,7 @@ class BookmarkApplicationTests(APITestCase):
student_id = response.data.get('student').get('id')
new_user = User.objects.create_user('dummy.company2', 'dummy.compan2y@company.com', 'lalala123')
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",status=Company.VERIFIED,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())
url = '/api/students/' + str(student_id) + '/bookmarked-vacancies/'
......@@ -144,6 +144,7 @@ class BookmarkApplicationTests(APITestCase):
response = self.client.delete(url)
self.assertEqual(response.status_code, status.HTTP_200_OK)
class VacancyTest(APITestCase):
def test_verified_vacancy_list(self):
superuser = User.objects.create_superuser('dummy.company', 'dummy.company@company.com', 'lalala123')
......@@ -171,7 +172,7 @@ class CompanyListsTests(APITestCase):
def test_company_vacancy_list_exist(self):
new_user = User.objects.create_user('dummy.company3', 'dummy.company3@company.com', 'lalala123')
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", status=Company.VERIFIED, logo=None, address=None)
url = '/api/companies/' + str(new_company.pk) + '/vacancies'
response = self.client.post(url, format='json')
......@@ -179,7 +180,7 @@ class CompanyListsTests(APITestCase):
def test_company_application_list_exist(self):
new_user = User.objects.create_user('dummy.company4', 'dummy.company4@company.com', 'lalala123')
new_company = Company.objects.create(user=new_user, description="lalala", verified=True, logo=None,
new_company = Company.objects.create(user=new_user, description="lalala", status=Company.VERIFIED, logo=None,
address=None)
url = '/api/companies/' + str(new_company.pk) + '/applications'
......
Markdown is supported
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