Skip to content

Commit

Permalink
AAQ V2 search FAQ endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Hlamallama committed Aug 1, 2024
1 parent dd493a4 commit 3d28bf6
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions aaq/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
from rest_framework import status
from rest_framework.test import APITestCase

from aaq.serializers import SearchSerializer

from .helpers import FakeAaqApi, FakeAaqCoreApi, FakeAaqUdApi, FakeTask


Expand Down Expand Up @@ -306,15 +304,15 @@ def test_search(self):
self.assertIn("feedback_secret_key", response.data)

assert response.json() == {
"message": "*0* - Example content title\n*1* - Another example content title",
"body": {
"0": {"text": "Example content text", "id": 23},
"1": {"text": "Another example content text", "id": 12},
},
"feedback_secret_key": "secret-key-12345-abcde",
"query_id": 1,
'message': '*0* - Example content title\n*1* - Another example content title',
'body': {
'0': {'text': 'Example content text', 'id': 23},
'1': {'text': 'Another example content text', 'id': 12}
}, 'feedback_secret_key': 'secret-key-12345-abcde',
'query_id': 1,
}


@responses.activate
def test_search_gibberish(self):
"""
Expand Down Expand Up @@ -349,6 +347,7 @@ def test_search_gibberish(self):
"query_id": 1,
}


@responses.activate
def test_search_invalid_request_body(self):
"""
Expand All @@ -364,4 +363,4 @@ def test_search_invalid_request_body(self):
)

self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertEqual(response.json(), {"query_text": ["This field is required."]})
self.assertEqual(response.json(), {'query_text': ['This field is required.']})

0 comments on commit 3d28bf6

Please sign in to comment.