@@ -127,7 +127,10 @@ def test_action_property(self, payload, expected):
127127
128128class TestInstallationManager :
129129 @pytest .mark .asyncio
130- async def test_acreate_from_event (self , create_event , override_app_settings ):
130+ @pytest .mark .parametrize ("app_settings_app_id_type" , [int , str ])
131+ async def test_acreate_from_event (
132+ self , app_settings_app_id_type , create_event , override_app_settings
133+ ):
131134 repositories = [
132135 {"id" : seq .next (), "node_id" : "node1" , "full_name" : "owner/repo1" },
133136 {"id" : seq .next (), "node_id" : "node2" , "full_name" : "owner/repo2" },
@@ -144,7 +147,11 @@ async def test_acreate_from_event(self, create_event, override_app_settings):
144147 "installation" ,
145148 )
146149
147- with override_app_settings (APP_ID = str (installation_data ["app_id" ])):
150+ with override_app_settings (
151+ APP_ID = installation_data ["app_id" ]
152+ if isinstance (app_settings_app_id_type , int )
153+ else str (installation_data ["app_id" ])
154+ ):
148155 installation = await Installation .objects .acreate_from_event (event )
149156
150157 assert installation .installation_id == installation_data ["id" ]
@@ -153,7 +160,10 @@ async def test_acreate_from_event(self, create_event, override_app_settings):
153160 installation = installation
154161 ).acount () == len (repositories )
155162
156- def test_create_from_event (self , create_event , override_app_settings ):
163+ @pytest .mark .parametrize ("app_settings_app_id_type" , [int , str ])
164+ def test_create_from_event (
165+ self , app_settings_app_id_type , create_event , override_app_settings
166+ ):
157167 repositories = [
158168 {"id" : seq .next (), "node_id" : "node1" , "full_name" : "owner/repo1" },
159169 {"id" : seq .next (), "node_id" : "node2" , "full_name" : "owner/repo2" },
@@ -170,7 +180,11 @@ def test_create_from_event(self, create_event, override_app_settings):
170180 "installation" ,
171181 )
172182
173- with override_app_settings (APP_ID = str (installation_data ["app_id" ])):
183+ with override_app_settings (
184+ APP_ID = installation_data ["app_id" ]
185+ if isinstance (app_settings_app_id_type , int )
186+ else str (installation_data ["app_id" ])
187+ ):
174188 installation = Installation .objects .create_from_event (event )
175189
176190 assert installation .installation_id == installation_data ["id" ]
0 commit comments