changed env variables names

This commit is contained in:
uttamthummala 2023-10-19 03:03:18 +05:30
parent 653755d4c9
commit 729d3ef59a
2 changed files with 6 additions and 8 deletions

View File

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

View File

@ -15,13 +15,13 @@ class StudentViewsTestCase(APITestCase):
def setUp(self): def setUp(self):
self.client = APIClient() self.client = APIClient()
self.user = User.objects.create( self.user = User.objects.create(
email=str(os.environ.get("email_id")), email=str(os.environ.get("EMAIL")),
id=str(os.environ.get("roll_no")), id=str(os.environ.get("ROLL_NO")),
user_type=[STUDENT]) user_type=[STUDENT])
self.assertEqual( self.assertEqual(
self.user.email, User.objects.get(id=self.user.id).email) self.user.email, User.objects.get(id=self.user.id).email)
self.student = Student.objects.create( 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, can_apply_internship=True, degree="bTech", cpi=7.95,
) )
self.assertEqual(self.student.name, self.assertEqual(self.student.name,
@ -61,7 +61,7 @@ class StudentViewsTestCase(APITestCase):
# get token from google OAuth API # get token from google OAuth API
response = self.client.post(reverse('Refresh Token'), { 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'] self.student_token = response.data['id_token']
def test_student_accept_offer_internship(self): def test_student_accept_offer_internship(self):