File tree 1 file changed +32
-0
lines changed
readthedocs/rtd_tests/tests
1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -1345,6 +1345,38 @@ def test_github_skip_signature_validation(self, trigger_build):
1345
1345
)
1346
1346
self .assertEqual (resp .status_code , 200 )
1347
1347
1348
+ def test_github_sync_on_push_event (self , trigger_build ):
1349
+ """Sync if the webhook doesn't have the create/delete events, but we recieve a push event with created/deleted."""
1350
+ integration = Integration .objects .create (
1351
+ project = self .project ,
1352
+ integration_type = Integration .GITHUB_WEBHOOK ,
1353
+ provider_data = {
1354
+ 'events' : [],
1355
+ },
1356
+ secret = None ,
1357
+ )
1358
+
1359
+ client = APIClient ()
1360
+
1361
+ headers = {
1362
+ GITHUB_EVENT_HEADER : GITHUB_PUSH ,
1363
+ }
1364
+ payload = {
1365
+ 'ref' : 'master' ,
1366
+ 'created' : True ,
1367
+ 'deleted' : False ,
1368
+ }
1369
+ resp = client .post (
1370
+ reverse (
1371
+ 'api_webhook_github' ,
1372
+ kwargs = {'project_slug' : self .project .slug }
1373
+ ),
1374
+ payload ,
1375
+ format = 'json' ,
1376
+ ** headers
1377
+ )
1378
+ self .assertTrue (resp .json ()['versions_synced' ])
1379
+
1348
1380
def test_github_dont_trigger_double_sync (self , trigger_build ):
1349
1381
"""Don't trigger a sync twice if the webhook has the create/delete events."""
1350
1382
integration = Integration .objects .create (
You can’t perform that action at this time.
0 commit comments