13
13
)
14
14
from tests .conftest import ENPTestClient
15
15
16
+ _push_path = '/legacy/v2/notifications/push'
17
+
16
18
17
19
@pytest .mark .asyncio
18
20
@patch .object (BackgroundTasks , 'add_task' )
@@ -47,7 +49,7 @@ async def test_router_returns_400_with_invalid_request_data(
47
49
'personalization' : 'not_a_dict' ,
48
50
}
49
51
50
- response = client .post ('/v2/notifications/push' , json = invalid_request )
52
+ response = client .post (_push_path , json = invalid_request )
51
53
52
54
assert response .status_code == status .HTTP_400_BAD_REQUEST
53
55
@@ -80,7 +82,7 @@ async def test_router_returns_500_when_other_exception_thrown(
80
82
personalisation = {'name' : 'John' },
81
83
)
82
84
83
- response = client .post ('/v2/notifications/push' , json = request .model_dump ())
85
+ response = client .post (_push_path , json = request .model_dump ())
84
86
85
87
assert response .status_code == status .HTTP_500_INTERNAL_SERVER_ERROR
86
88
@@ -90,7 +92,7 @@ async def test_router_returns_500_when_other_exception_thrown(
90
92
@patch ('app.legacy.v2.notifications.rest.dao_create_notification' )
91
93
@patch ('app.legacy.v2.notifications.rest.validate_template' )
92
94
class TestPush :
93
- """Test POST /v2/notifications/push."""
95
+ """Test POST /legacy/ v2/notifications/push."""
94
96
95
97
async def test_post_push_returns_201 (
96
98
self ,
@@ -120,7 +122,7 @@ async def test_post_push_returns_201(
120
122
personalisation = {'name' : 'John' },
121
123
)
122
124
123
- response = client .post ('/v2/notifications/push' , json = request .model_dump ())
125
+ response = client .post (_push_path , json = request .model_dump ())
124
126
125
127
assert response .status_code == status .HTTP_201_CREATED
126
128
assert response .json () == {'result' : 'success' } == V2PostPushResponseModel ().model_dump ()
@@ -153,6 +155,6 @@ async def test_post_push_returns_400_when_unable_to_validate_template(
153
155
personalisation = {'name' : 'John' },
154
156
)
155
157
156
- response = client .post ('/v2/notifications/push' , json = request .model_dump ())
158
+ response = client .post (_push_path , json = request .model_dump ())
157
159
158
160
assert response .status_code == status .HTTP_400_BAD_REQUEST
0 commit comments