Skip to content

Commit

Permalink
Merge branch 'feature/139-tests-for-partner' of https://github.com/IS…
Browse files Browse the repository at this point in the history
…PP-G5/NexONG_Backend into feature/139-tests-for-partner
  • Loading branch information
mromalde committed May 5, 2024
2 parents e474ef8 + 07fb3e9 commit 3ae8358
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions nexong/api/Event/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,7 @@ def test_update_lesson_event_by_volunteer(self):
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.lessonevent2.refresh_from_db()


class PartnerEventApiViewSetTestCase(TestCase):
def setUp(self):
self.factory = APIRequestFactory()
Expand All @@ -797,7 +798,7 @@ def setUp(self):
username="usuariotest",
email="usuariotets@gmail.com",
role=PARTNER,
partner=self.partner3
partner=self.partner3,
)

self.token = Token.objects.create(user=self.user2)
Expand Down Expand Up @@ -862,7 +863,7 @@ def setUp(self):
)
self.event2.attendees.add(self.student, self.student2)
self.event2.volunteers.add(self.voluntario, self.voluntario2)

def test_obtain_event_by_partner(self):
response = self.client.get(
f"/api/event/{self.event2.id}/",
Expand Down Expand Up @@ -892,4 +893,4 @@ def test_create_event_by_partner_error(self):
},
HTTP_AUTHORIZATION=f"Token {self.token.key}",
)
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)

0 comments on commit 3ae8358

Please sign in to comment.