@@ -19,7 +19,7 @@ def sign_payload(data: bytes, secret=PAYLOAD_SECRET):
1919
2020
2121class GenAIAuthViewTests (APITestCase ):
22- @patch ("utils.config .get_config" , return_value = PAYLOAD_SECRET )
22+ @patch ("api.gen_ai.views .get_config" , return_value = PAYLOAD_SECRET )
2323 def test_missing_parameters (self , mock_config ):
2424 payload = b"{}"
2525 sig , data = sign_payload (payload )
@@ -32,7 +32,7 @@ def test_missing_parameters(self, mock_config):
3232 self .assertEqual (response .status_code , 400 )
3333 self .assertIn ("Missing required parameters" , response .data )
3434
35- @patch ("utils.config .get_config" , return_value = PAYLOAD_SECRET )
35+ @patch ("api.gen_ai.views .get_config" , return_value = PAYLOAD_SECRET )
3636 def test_invalid_signature (self , mock_config ):
3737 # Correct payload
3838 payload = b'{"external_owner_id":"owner1","repo_service_id":"101"}'
@@ -46,7 +46,7 @@ def test_invalid_signature(self, mock_config):
4646 )
4747 self .assertEqual (response .status_code , 403 )
4848
49- @patch ("utils.config .get_config" , return_value = PAYLOAD_SECRET )
49+ @patch ("api.gen_ai.views .get_config" , return_value = PAYLOAD_SECRET )
5050 def test_owner_not_found (self , mock_config ):
5151 payload = b'{"external_owner_id":"nonexistent_owner","repo_service_id":"101"}'
5252 sig , data = sign_payload (payload )
@@ -58,7 +58,7 @@ def test_owner_not_found(self, mock_config):
5858 )
5959 self .assertEqual (response .status_code , 404 )
6060
61- @patch ("utils.config .get_config" , return_value = PAYLOAD_SECRET )
61+ @patch ("api.gen_ai.views .get_config" , return_value = PAYLOAD_SECRET )
6262 def test_no_installation (self , mock_config ):
6363 # Create a valid owner but no installation
6464 OwnerFactory (service = "github" , service_id = "owner1" , username = "test1" )
@@ -73,7 +73,7 @@ def test_no_installation(self, mock_config):
7373 self .assertEqual (response .status_code , 200 )
7474 self .assertEqual (response .data , {"is_valid" : False })
7575
76- @patch ("utils.config .get_config" , return_value = PAYLOAD_SECRET )
76+ @patch ("api.gen_ai.views .get_config" , return_value = PAYLOAD_SECRET )
7777 def test_authorized (self , mock_config ):
7878 owner = OwnerFactory (service = "github" , service_id = "owner2" , username = "test2" )
7979 GithubAppInstallation .objects .create (
@@ -93,7 +93,7 @@ def test_authorized(self, mock_config):
9393 self .assertEqual (response .status_code , status .HTTP_200_OK )
9494 self .assertEqual (response .data , {"is_valid" : True })
9595
96- @patch ("utils.config .get_config" , return_value = PAYLOAD_SECRET )
96+ @patch ("api.gen_ai.views .get_config" , return_value = PAYLOAD_SECRET )
9797 def test_unauthorized (self , mock_config ):
9898 owner = OwnerFactory (service = "github" , service_id = "owner3" , username = "test3" )
9999 GithubAppInstallation .objects .create (
0 commit comments