Skip to content

Commit

Permalink
feat: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
helllllllder committed Oct 8, 2024
1 parent f81d16a commit ff89071
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 4 deletions.
19 changes: 15 additions & 4 deletions chats/apps/rooms/tests/test_viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,21 @@ def setUp(self):

# ROOMS
self.room_1 = Room.objects.create(
contact=self.contact, queue=self.queue_1, user=self.agent
contact=self.contact,
queue=self.queue_1,
user=self.agent,
project_uuid=str(self.project.uuid),
)
self.room_2 = Room.objects.create(
contact=self.contact_2,
queue=self.queue_2,
project_uuid=str(self.project.uuid),
)
self.room_3 = Room.objects.create(
contact=self.contact_3,
queue=self.queue_3,
project_uuid=str(self.project.uuid),
)
self.room_2 = Room.objects.create(contact=self.contact_2, queue=self.queue_2)
self.room_3 = Room.objects.create(contact=self.contact_3, queue=self.queue_3)

def _request_list_rooms(self, token, data: dict):
url = reverse("room-list")
Expand All @@ -112,8 +123,8 @@ def _request_list_rooms(self, token, data: dict):
def _ok_list_rooms(self, token, rooms: list, data: dict):
response, results = self._request_list_rooms(token, data)
self.assertEqual(response.status_code, status.HTTP_200_OK)

self.assertEqual(response.json().get("count"), len(rooms))

for result in results:
self.assertIn(result.get("uuid"), rooms)

Expand Down
2 changes: 2 additions & 0 deletions chats/fixtures/fixture_app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2218,6 +2218,7 @@
"ended_at": null,
"ended_by": null,
"is_active": true,
"project_uuid": "34a93b52-231e-11ed-861d-0242ac120002",
"transfer_history": [
{
"name": "ENGINE",
Expand Down Expand Up @@ -2248,6 +2249,7 @@
"ended_at": "2022-08-26T11:30:05.198Z",
"ended_by": "agent",
"is_active": true,
"project_uuid": "34a93b52-231e-11ed-861d-0242ac120002",
"transfer_history": [
{
"name": "",
Expand Down
14 changes: 14 additions & 0 deletions chats/fixtures/fixture_discussion.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"ended_at": null,
"ended_by": null,
"is_active": true,
"project_uuid": "34a93b52-231e-11ed-861d-0242ac120002",
"transfer_history": [
{
"name": "ENGINE",
Expand Down Expand Up @@ -46,6 +47,7 @@
"ended_at": null,
"ended_by": null,
"is_active": true,
"project_uuid": "34a93b52-231e-11ed-861d-0242ac120002",
"transfer_history": [
{
"name": "ENGINE",
Expand Down Expand Up @@ -76,6 +78,7 @@
"ended_at": "2023-09-03T00:20:09.559Z",
"ended_by": "agent",
"is_active": false,
"project_uuid": "34a93b52-231e-11ed-861d-0242ac120002",
"transfer_history": [
{
"name": "ENGINE",
Expand Down Expand Up @@ -626,6 +629,7 @@
"ended_by": null,
"is_active": true,
"is_waiting": false,
"project_uuid": "dae39bcc-bdc2-4b03-b4da-023a117f8474",
"transfer_history": {
"to": {
"name": "teste",
Expand Down Expand Up @@ -656,6 +660,7 @@
"ended_by": null,
"is_active": true,
"is_waiting": false,
"project_uuid": "dae39bcc-bdc2-4b03-b4da-023a117f8474",
"transfer_history": {
"to": {
"name": "Suporte Tecnico",
Expand Down Expand Up @@ -686,6 +691,7 @@
"ended_by": null,
"is_active": true,
"is_waiting": false,
"project_uuid": "dae39bcc-bdc2-4b03-b4da-023a117f8474",
"transfer_history": {
"to": {
"name": "Suporte Tecnico",
Expand Down Expand Up @@ -716,6 +722,7 @@
"ended_by": null,
"is_active": true,
"is_waiting": false,
"project_uuid": "dae39bcc-bdc2-4b03-b4da-023a117f8474",
"transfer_history": {
"to": {
"name": "Suporte Tecnico",
Expand Down Expand Up @@ -746,6 +753,7 @@
"ended_by": null,
"is_active": true,
"is_waiting": false,
"project_uuid": "dae39bcc-bdc2-4b03-b4da-023a117f8474",
"transfer_history": {
"to": {
"name": "Empreendimentos",
Expand Down Expand Up @@ -776,6 +784,7 @@
"ended_by": null,
"is_active": true,
"is_waiting": false,
"project_uuid": "dae39bcc-bdc2-4b03-b4da-023a117f8474",
"transfer_history": {
"to": {
"name": "teste",
Expand Down Expand Up @@ -806,6 +815,7 @@
"ended_by": null,
"is_active": true,
"is_waiting": false,
"project_uuid": "dae39bcc-bdc2-4b03-b4da-023a117f8474",
"transfer_history": {
"to": {
"name": "Construção Propria",
Expand Down Expand Up @@ -836,6 +846,7 @@
"ended_by": null,
"is_active": true,
"is_waiting": false,
"project_uuid": "dae39bcc-bdc2-4b03-b4da-023a117f8474",
"transfer_history": {
"to": {
"name": "Construção Propria",
Expand Down Expand Up @@ -866,6 +877,7 @@
"ended_by": null,
"is_active": true,
"is_waiting": false,
"project_uuid": "dae39bcc-bdc2-4b03-b4da-023a117f8474",
"transfer_history": {
"to": {
"name": "teste",
Expand Down Expand Up @@ -896,6 +908,7 @@
"ended_by": null,
"is_active": true,
"is_waiting": false,
"project_uuid": "dae39bcc-bdc2-4b03-b4da-023a117f8474",
"transfer_history": {
"to": {
"name": "teste",
Expand Down Expand Up @@ -926,6 +939,7 @@
"ended_by": "agent",
"is_active": false,
"is_waiting": false,
"project_uuid": "dae39bcc-bdc2-4b03-b4da-023a117f8474",
"transfer_history": {
"to": {
"name": "teste",
Expand Down
3 changes: 3 additions & 0 deletions chats/fixtures/fixture_room.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"ended_at": null,
"ended_by": null,
"is_active": true,
"project_uuid": "34a93b52-231e-11ed-861d-0242ac120002",
"transfer_history": [
{
"name": "ENGINE",
Expand Down Expand Up @@ -46,6 +47,7 @@
"ended_at": null,
"ended_by": null,
"is_active": true,
"project_uuid": "34a93b52-231e-11ed-861d-0242ac120002",
"transfer_history": [
{
"name": "ENGINE",
Expand Down Expand Up @@ -76,6 +78,7 @@
"ended_at": "2023-09-03T00:20:09.559Z",
"ended_by": "agent",
"is_active": false,
"project_uuid": "34a93b52-231e-11ed-861d-0242ac120002",
"transfer_history": [
{
"name": "ENGINE",
Expand Down
1 change: 1 addition & 0 deletions chats/fixtures/fixture_sector.json
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@
"ended_at": null,
"ended_by": null,
"is_active": true,
"project_uuid": "34a93b52-231e-11ed-861d-0242ac120002",
"transfer_history": [
{
"name": "ENGINE",
Expand Down

0 comments on commit ff89071

Please sign in to comment.