@@ -33,7 +33,7 @@ def _authenticate_user(test_client: TestClient, user: User, generator: DataGener
3333
3434def test_get_notifications_without_auth (test_client : TestClient ):
3535 """Test that accessing notifications without auth returns 403"""
36- response = test_client .get ("/v1/notifications" )
36+ response = test_client .get ("/v1/users/me/ notifications" )
3737 assert response .status_code == 403
3838
3939
@@ -58,7 +58,7 @@ def test_get_notifications(test_client: TestClient, generator: DataGenerator):
5858
5959 _authenticate_user (test_client , user , generator )
6060 response = make_authenticated_request (
61- lambda : test_client .get ("/v1/notifications" , headers = {"X-CSRF-Token" : "1" }),
61+ lambda : test_client .get ("/v1/users/me/ notifications" , headers = {"X-CSRF-Token" : "1" }),
6262 Permission .view_notification ,
6363 )
6464
@@ -74,7 +74,7 @@ def test_get_notifications(test_client: TestClient, generator: DataGenerator):
7474
7575def test_get_unread_count_without_auth (test_client : TestClient ):
7676 """Test that accessing unread count without auth returns 403"""
77- response = test_client .get ("/v1/notifications/unread-count" )
77+ response = test_client .get ("/v1/users/me/ notifications/unread-count" )
7878 assert response .status_code == 403
7979
8080
@@ -91,7 +91,7 @@ def test_get_unread_count(test_client: TestClient, generator: DataGenerator):
9191
9292 _authenticate_user (test_client , user , generator )
9393 response = make_authenticated_request (
94- lambda : test_client .get ("/v1/notifications/unread-count" , headers = {"X-CSRF-Token" : "1" }),
94+ lambda : test_client .get ("/v1/users/me/ notifications/unread-count" , headers = {"X-CSRF-Token" : "1" }),
9595 Permission .view_notification ,
9696 )
9797
@@ -104,7 +104,7 @@ def test_mark_notification_as_read_without_auth(test_client: TestClient, generat
104104 user = generator .gen_user (email = "mark-no-auth@test.com" )
105105 notification = generator .gen_notification (user = user )
106106
107- response = test_client .post (f"/v1/notifications/{ notification .id } /dismiss" )
107+ response = test_client .post (f"/v1/users/me/ notifications/{ notification .id } /dismiss" )
108108 assert response .status_code == 403
109109
110110
@@ -117,7 +117,9 @@ def test_mark_notification_as_read(test_client: TestClient, generator: DataGener
117117
118118 _authenticate_user (test_client , user , generator )
119119 response = make_authenticated_request (
120- lambda : test_client .post (f"/v1/notifications/{ notification .id } /dismiss" , headers = {"X-CSRF-Token" : "1" }),
120+ lambda : test_client .post (
121+ f"/v1/users/me/notifications/{ notification .id } /dismiss" , headers = {"X-CSRF-Token" : "1" }
122+ ),
121123 Permission .change_notification ,
122124 )
123125
@@ -135,7 +137,9 @@ def test_mark_notification_as_read_wrong_user(test_client: TestClient, generator
135137
136138 _authenticate_user (test_client , other_user , generator )
137139 response = make_authenticated_request (
138- lambda : test_client .post (f"/v1/notifications/{ notification .id } /dismiss" , headers = {"X-CSRF-Token" : "1" }),
140+ lambda : test_client .post (
141+ f"/v1/users/me/notifications/{ notification .id } /dismiss" , headers = {"X-CSRF-Token" : "1" }
142+ ),
139143 Permission .change_notification ,
140144 )
141145
@@ -148,7 +152,7 @@ def test_mark_nonexistent_notification_as_read(test_client: TestClient, generato
148152
149153 _authenticate_user (test_client , user , generator )
150154 response = make_authenticated_request (
151- lambda : test_client .post ("/v1/notifications/99999/dismiss" , headers = {"X-CSRF-Token" : "1" }),
155+ lambda : test_client .post ("/v1/users/me/ notifications/99999/dismiss" , headers = {"X-CSRF-Token" : "1" }),
152156 Permission .change_notification ,
153157 )
154158
@@ -173,7 +177,7 @@ def test_get_notifications_with_pagination(test_client: TestClient, generator: D
173177
174178 # Test limit
175179 response = make_authenticated_request (
176- lambda : test_client .get ("/v1/notifications?limit=2" , headers = {"X-CSRF-Token" : "1" }),
180+ lambda : test_client .get ("/v1/users/me/ notifications?limit=2" , headers = {"X-CSRF-Token" : "1" }),
177181 Permission .view_notification ,
178182 )
179183 assert response .status_code == 200
@@ -185,7 +189,7 @@ def test_get_notifications_with_pagination(test_client: TestClient, generator: D
185189
186190 # Test offset
187191 response = make_authenticated_request (
188- lambda : test_client .get ("/v1/notifications?limit=2&offset=2" , headers = {"X-CSRF-Token" : "1" }),
192+ lambda : test_client .get ("/v1/users/me/ notifications?limit=2&offset=2" , headers = {"X-CSRF-Token" : "1" }),
189193 Permission .view_notification ,
190194 )
191195 assert response .status_code == 200
@@ -197,7 +201,7 @@ def test_get_notifications_with_pagination(test_client: TestClient, generator: D
197201
198202 # Test offset beyond results
199203 response = make_authenticated_request (
200- lambda : test_client .get ("/v1/notifications?limit=10&offset=3" , headers = {"X-CSRF-Token" : "1" }),
204+ lambda : test_client .get ("/v1/users/me/ notifications?limit=10&offset=3" , headers = {"X-CSRF-Token" : "1" }),
201205 Permission .view_notification ,
202206 )
203207 assert response .status_code == 200
0 commit comments