Skip to content

Commit

Permalink
add assert for bearer token
Browse files Browse the repository at this point in the history
  • Loading branch information
Hlamallama committed Sep 4, 2024
1 parent d8986d8 commit 1b2ae97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions aaq/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def test_search_function(self):
self.assertIn("query_id", response)
self.assertEqual(response["query_id"], 1)
self.assertEqual(json.loads(search_request.request.body), payload)
self.assertIn("Bearer", search_request.request.headers['Authorization'])
self.assertIn("Bearer", search_request.request.headers["Authorization"])
assert response == {
"message": "*0* - Example content title\n"
"*1* - Another example content title",
Expand Down Expand Up @@ -95,7 +95,7 @@ def test_urgency_check(self):
self.assertIn("is_urgent", response)
self.assertIn("matched_rules", response)
self.assertEqual(json.loads(request.request.body), message_text)
self.assertIn("Bearer", request.request.headers['Authorization'])
self.assertIn("Bearer", request.request.headers["Authorization"])

assert response == {
"details": {
Expand Down
4 changes: 2 additions & 2 deletions aaq/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def test_response_feedback_view(self):
request = responses.calls[0]

assert response.status_code == 200
self.assertIn("Bearer", request.request.headers['Authorization'])
self.assertIn("Bearer", request.request.headers["Authorization"])

def test_response_feedback_invalid_view(self):
"""Test that we can submit response feedback"""
Expand Down Expand Up @@ -494,7 +494,7 @@ def test_content_feedback_view(self):
request = responses.calls[0]

assert response.status_code == 200
self.assertIn("Bearer", request.request.headers['Authorization'])
self.assertIn("Bearer", request.request.headers["Authorization"])

def test_content_feedback_invalid_view(self):
"""Test that we can submit content feedback"""
Expand Down

0 comments on commit 1b2ae97

Please sign in to comment.