Merge branch 'Internship-Update' of https://github.com/uttamthummala/cdc-placement-website-backend into pr/uttamthummala/178

This commit is contained in:
karthikmurakonda 2023-10-19 03:09:37 +05:30
commit 497b7f0a3c
2 changed files with 6 additions and 8 deletions

View File

@ -14,9 +14,7 @@ class AdminView(APITestCase):
def setUp(self):
self.client = APIClient()
self.admin = User.objects.create(email=str(os.environ.get(
"email_id")), id=generateRandomString(), user_type=[ADMIN])
self.s_admin = User.objects.create(email=str(os.environ.get(
"s_email")), id=generateRandomString(), user_type=["s_admin"])
"EMAIL")), id=generateRandomString(), user_type=[ADMIN])
self.user1 = User.objects.create(
email="200010032@iitdh.ac.in", id="200010032", user_type=[STUDENT])
self.user2 = User.objects.create(
@ -79,7 +77,7 @@ class AdminView(APITestCase):
id=generateRandomString(), student=self.student3, internship=self.internship2, resume="8BSLybntULgrPPm_beehyv.pdf")
response = self.client.post(reverse('Refresh Token'), {
'refresh_token': os.environ.get("refresh_token")}, format='json')
'refresh_token': os.environ.get("REFRESH_TOKEN")}, format='json')
self.assertEqual(response.status_code, status.HTTP_200_OK)

View File

@ -15,13 +15,13 @@ class StudentViewsTestCase(APITestCase):
def setUp(self):
self.client = APIClient()
self.user = User.objects.create(
email=str(os.environ.get("email_id")),
id=str(os.environ.get("roll_no")),
email=str(os.environ.get("EMAIL")),
id=str(os.environ.get("ROLL_NO")),
user_type=[STUDENT])
self.assertEqual(
self.user.email, User.objects.get(id=self.user.id).email)
self.student = Student.objects.create(
name="Test Student", id=self.user.id, resumes=["8BSLybntULgrPPm_beehyv.pdf"], roll_no=str(os.environ.get("roll_no")), branch="CSE", batch="2020", phone_number=1234567890, changed_by=self.user, can_apply=True,
name="Test Student", id=self.user.id, resumes=["8BSLybntULgrPPm_beehyv.pdf"], roll_no=str(os.environ.get("ROLL_NO")), branch="CSE", batch="2020", phone_number=1234567890, changed_by=self.user, can_apply=True,
can_apply_internship=True, degree="bTech", cpi=7.95,
)
self.assertEqual(self.student.name,
@ -61,7 +61,7 @@ class StudentViewsTestCase(APITestCase):
# get token from google OAuth API
response = self.client.post(reverse('Refresh Token'), {
'refresh_token': os.environ.get("refresh_token")}, format='json')
'refresh_token': os.environ.get("REFRESH_TOKEN")}, format='json')
self.student_token = response.data['id_token']
def test_student_accept_offer_internship(self):