fixed error in test

This commit is contained in:
uttamthummala 2023-10-20 19:42:16 +05:30
parent 9e95da5e03
commit e428602ed5
1 changed files with 3 additions and 3 deletions

View File

@ -1199,7 +1199,7 @@ class AdminView(APITestCase):
self.assertEqual(Internship.objects.get( self.assertEqual(Internship.objects.get(
id=self.internship1.id).offer_accepted, True) id=self.internship1.id).offer_accepted, True)
self.internship1.refresh_from_db() self.internship1.refresh_from_db()
self.assertEqual(self.internship1.deadline_datetime, timezone.now().replace( self.assertEqual(self.internship1.deadline_datetime, timezone.localtime(timezone.now()).replace(
hour=0, minute=0, second=0, microsecond=0)+timezone.timedelta(days=2)) hour=0, minute=0, second=0, microsecond=0)+timezone.timedelta(days=2))
def test_updateofferAccepted_withDeadline_internship(self): def test_updateofferAccepted_withDeadline_internship(self):
@ -1208,7 +1208,7 @@ class AdminView(APITestCase):
"opening_type": "Internship", "opening_type": "Internship",
"opening_id": self.internship3.id, "opening_id": self.internship3.id,
"offer_accepted": "true", "offer_accepted": "true",
"deadline_datetime": (timezone.now().replace( "deadline_datetime": (timezone.localtime(timezone.now()).replace(
hour=0, minute=0, second=0, microsecond=0)+timezone.timedelta(days=1)).strftime('%Y-%m-%d %H:%M:%S %z') hour=0, minute=0, second=0, microsecond=0)+timezone.timedelta(days=1)).strftime('%Y-%m-%d %H:%M:%S %z')
} }
self.admin.user_type = ["s_admin"] self.admin.user_type = ["s_admin"]
@ -1219,7 +1219,7 @@ class AdminView(APITestCase):
self.internship3.refresh_from_db() self.internship3.refresh_from_db()
self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(Internship.objects.get( self.assertEqual(Internship.objects.get(
id=self.internship3.id).deadline_datetime, timezone.now().replace(hour=0, minute=0, second=0, microsecond=0)+timezone.timedelta(days=1)) id=self.internship3.id).deadline_datetime, timezone.localtime(timezone.now()).replace(hour=0, minute=0, second=0, microsecond=0)+timezone.timedelta(days=1))
self.assertEqual(response.data['message'], 'Offer Accepted Updated') self.assertEqual(response.data['message'], 'Offer Accepted Updated')
def test_updateofferAccepted_wrongOpening_internship(self): def test_updateofferAccepted_wrongOpening_internship(self):