@@ -318,7 +318,7 @@ async def test_news_likes_endpoint(
318318 response = await async_client .post (
319319 f"/api/news/{ stored_news .id } /like" ,
320320 json = {"email" : emails [0 ]},
321- headers = valid_auth_headers ,
321+ headers = { ** valid_auth_headers , "user-email" : emails [ 0 ]} ,
322322 )
323323 assert response .status_code == status .HTTP_200_OK
324324 statement = select (News ).where (News .title == news_data ["title" ])
@@ -329,8 +329,7 @@ async def test_news_likes_endpoint(
329329
330330 response = await async_client .post (
331331 f"/api/news/{ stored_news .id } /like" ,
332- json = {"email" : emails [1 ]},
333- headers = valid_auth_headers ,
332+ headers = {** valid_auth_headers , "user-email" : emails [1 ]},
334333 )
335334 assert response .status_code == status .HTTP_200_OK
336335 statement = select (News ).where (News .title == news_data ["title" ])
@@ -345,8 +344,7 @@ async def test_news_likes_endpoint(
345344 # Remove likes
346345 response = await async_client .delete (
347346 f"/api/news/{ stored_news .id } /like" ,
348- params = {"email" : emails [0 ]},
349- headers = valid_auth_headers ,
347+ headers = {** valid_auth_headers , "user-email" : emails [0 ]},
350348 )
351349 assert response .status_code == status .HTTP_200_OK
352350 statement = select (News ).where (News .title == news_data ["title" ])
@@ -357,8 +355,7 @@ async def test_news_likes_endpoint(
357355
358356 response = await async_client .delete (
359357 f"/api/news/{ stored_news .id } /like" ,
360- params = {"email" : emails [1 ]},
361- headers = valid_auth_headers ,
358+ headers = {** valid_auth_headers , "user-email" : emails [1 ]},
362359 )
363360 assert response .status_code == status .HTTP_200_OK
364361 statement = select (News ).where (News .title == news_data ["title" ])
0 commit comments