@@ -53,6 +53,8 @@ def test_guest_user_permission(self):
5353 "/api/v2/language/" ,
5454 f"/api/v2/language/{ id } /" ,
5555 "/api/v2/event/" ,
56+ "/api/v2/ops-learning/" ,
57+ f"/api/v2/ops-learning/{ id } /" ,
5658 ]
5759
5860 go_post_apis = [
@@ -73,6 +75,7 @@ def test_guest_user_permission(self):
7375 "/api/v2/per-file/multiple/" ,
7476 "/api/v2/per-prioritization/" ,
7577 "/api/v2/per-work-plan/" ,
78+ "/api/v2/ops-learning/" ,
7679 "/api/v2/project/" ,
7780 "/api/v2/dref-files/" ,
7881 "/api/v2/dref-files/multiple/" ,
@@ -98,8 +101,6 @@ def test_guest_user_permission(self):
98101 f"/api/v2/flash-update/{ id } /" ,
99102 "/api/v2/local-units/" ,
100103 f"/api/v2/local-units/{ id } /" ,
101- "/api/v2/ops-learning/" ,
102- f"/api/v2/ops-learning/{ id } /" ,
103104 f"/api/v2/pdf-export/{ id } /" ,
104105 "/api/v2/per-assessment/" ,
105106 f"/api/v2/per-assessment/{ id } /" ,
@@ -138,7 +139,6 @@ def test_guest_user_permission(self):
138139 ]
139140
140141 go_post_apis_req_additional_perm = [
141- "/api/v2/ops-learning/" ,
142142 "/api/v2/per-overview/" ,
143143 f"/api/v2/user/{ id } /accepted_license_terms/" ,
144144 ]
@@ -167,6 +167,14 @@ def _failure_check(response, check_json_error_code=True):
167167 _success_check (event_pub_response )
168168 self .assertEqual (len (event_pub_response .json ()["results" ]), 1 )
169169
170+ # Unauthenticated user should be able to view operational learning
171+ ops_learning_response = self .client .get ("/api/v2/ops-learning/" )
172+ _success_check (ops_learning_response )
173+
174+ # Unauthenticated user should not be able to do post operations in operational learning
175+ ops_learning_response = self .client .post ("/api/v2/ops-learning/" , json = body )
176+ _failure_check (ops_learning_response , check_json_error_code = False )
177+
170178 # authenticate guest user
171179 self .authenticate (user = self .guest_user )
172180
0 commit comments