@@ -86,6 +86,7 @@ def setUp(self):
8686 start_date = timezone .now () - timedelta (days = 2 ),
8787 end_date = timezone .now () + timedelta (days = 1 ),
8888 approved_by_admin = False ,
89+ github_repository = "challenge/github_repo" ,
8990 )
9091 self .challenge .slug = "{}-{}" .format (
9192 self .challenge .title .replace (" " , "-" ).lower (), self .challenge .pk
@@ -203,6 +204,7 @@ def test_get_challenge(self):
203204 "worker_image_url" : self .challenge .worker_image_url ,
204205 "worker_instance_type" : self .challenge .worker_instance_type ,
205206 "sqs_retention_period" : self .challenge .sqs_retention_period ,
207+ "github_repository" : self .challenge .github_repository ,
206208 }
207209 ]
208210
@@ -574,6 +576,7 @@ def test_get_particular_challenge(self):
574576 "worker_image_url" : self .challenge .worker_image_url ,
575577 "worker_instance_type" : self .challenge .worker_instance_type ,
576578 "sqs_retention_period" : self .challenge .sqs_retention_period ,
579+ "github_repository" : self .challenge .github_repository ,
577580 }
578581 response = self .client .get (self .url , {})
579582 self .assertEqual (response .data , expected )
@@ -676,6 +679,7 @@ def test_update_challenge_when_user_is_its_creator(self):
676679 "worker_image_url" : self .challenge .worker_image_url ,
677680 "worker_instance_type" : self .challenge .worker_instance_type ,
678681 "sqs_retention_period" : self .challenge .sqs_retention_period ,
682+ "github_repository" : self .challenge .github_repository ,
679683 }
680684 response = self .client .put (
681685 self .url , {"title" : new_title , "description" : new_description }
@@ -804,6 +808,7 @@ def test_particular_challenge_partial_update(self):
804808 "worker_image_url" : self .challenge .worker_image_url ,
805809 "worker_instance_type" : self .challenge .worker_instance_type ,
806810 "sqs_retention_period" : self .challenge .sqs_retention_period ,
811+ "github_repository" : self .challenge .github_repository ,
807812 }
808813 response = self .client .patch (self .url , self .partial_update_data )
809814 self .assertEqual (response .data , expected )
@@ -881,6 +886,7 @@ def test_particular_challenge_update(self):
881886 "worker_image_url" : self .challenge .worker_image_url ,
882887 "worker_instance_type" : self .challenge .worker_instance_type ,
883888 "sqs_retention_period" : self .challenge .sqs_retention_period ,
889+ "github_repository" : self .challenge .github_repository ,
884890 }
885891 response = self .client .put (self .url , self .data )
886892 self .assertEqual (response .data , expected )
@@ -1344,6 +1350,7 @@ def setUp(self):
13441350 manual_participant_approval = False ,
13451351 start_date = timezone .now () - timedelta (days = 2 ),
13461352 end_date = timezone .now () + timedelta (days = 1 ),
1353+ github_repository = "challenge2/github_repo" ,
13471354 )
13481355
13491356 # Past Challenge challenge
@@ -1365,6 +1372,7 @@ def setUp(self):
13651372 manual_participant_approval = False ,
13661373 start_date = timezone .now () - timedelta (days = 2 ),
13671374 end_date = timezone .now () - timedelta (days = 1 ),
1375+ github_repository = "challenge3/github_repo" ,
13681376 )
13691377
13701378 # Future challenge
@@ -1385,6 +1393,7 @@ def setUp(self):
13851393 manual_participant_approval = False ,
13861394 start_date = timezone .now () + timedelta (days = 2 ),
13871395 end_date = timezone .now () + timedelta (days = 1 ),
1396+ github_repository = "challenge4/github_repo" ,
13881397 )
13891398
13901399 # Disabled challenge
@@ -1474,6 +1483,7 @@ def test_get_past_challenges(self):
14741483 "worker_image_url" : self .challenge3 .worker_image_url ,
14751484 "worker_instance_type" : self .challenge3 .worker_instance_type ,
14761485 "sqs_retention_period" : self .challenge3 .sqs_retention_period ,
1486+ "github_repository" : self .challenge3 .github_repository ,
14771487 }
14781488 ]
14791489 response = self .client .get (self .url , {}, format = "json" )
@@ -1552,11 +1562,12 @@ def test_get_present_challenges(self):
15521562 "job_memory" : self .challenge2 .job_memory ,
15531563 "uses_ec2_worker" : self .challenge2 .uses_ec2_worker ,
15541564 "evaluation_module_error" : self .challenge2 .evaluation_module_error ,
1555- "ec2_storage" : self .challenge .ec2_storage ,
1556- "ephemeral_storage" : self .challenge .ephemeral_storage ,
1557- "worker_image_url" : self .challenge .worker_image_url ,
1558- "worker_instance_type" : self .challenge .worker_instance_type ,
1559- "sqs_retention_period" : self .challenge .sqs_retention_period ,
1565+ "ec2_storage" : self .challenge2 .ec2_storage ,
1566+ "ephemeral_storage" : self .challenge2 .ephemeral_storage ,
1567+ "worker_image_url" : self .challenge2 .worker_image_url ,
1568+ "worker_instance_type" : self .challenge2 .worker_instance_type ,
1569+ "sqs_retention_period" : self .challenge2 .sqs_retention_period ,
1570+ "github_repository" : self .challenge2 .github_repository ,
15601571 }
15611572 ]
15621573 response = self .client .get (self .url , {}, format = "json" )
@@ -1640,6 +1651,7 @@ def test_get_future_challenges(self):
16401651 "worker_image_url" : self .challenge4 .worker_image_url ,
16411652 "worker_instance_type" : self .challenge4 .worker_instance_type ,
16421653 "sqs_retention_period" : self .challenge4 .sqs_retention_period ,
1654+ "github_repository" : self .challenge4 .github_repository ,
16431655 }
16441656 ]
16451657 response = self .client .get (self .url , {}, format = "json" )
@@ -1713,16 +1725,17 @@ def test_get_all_challenges(self):
17131725 "queue" : self .challenge4 .queue ,
17141726 "worker_cpu_cores" : 512 ,
17151727 "worker_memory" : 1024 ,
1716- "cpu_only_jobs" : self .challenge3 .cpu_only_jobs ,
1717- "job_cpu_cores" : self .challenge3 .job_cpu_cores ,
1718- "job_memory" : self .challenge3 .job_memory ,
1719- "uses_ec2_worker" : self .challenge3 .uses_ec2_worker ,
1720- "evaluation_module_error" : self .challenge3 .evaluation_module_error ,
1721- "ec2_storage" : self .challenge3 .ec2_storage ,
1722- "ephemeral_storage" : self .challenge3 .ephemeral_storage ,
1723- "worker_image_url" : self .challenge3 .worker_image_url ,
1724- "worker_instance_type" : self .challenge3 .worker_instance_type ,
1725- "sqs_retention_period" : self .challenge3 .sqs_retention_period ,
1728+ "cpu_only_jobs" : self .challenge4 .cpu_only_jobs ,
1729+ "job_cpu_cores" : self .challenge4 .job_cpu_cores ,
1730+ "job_memory" : self .challenge4 .job_memory ,
1731+ "uses_ec2_worker" : self .challenge4 .uses_ec2_worker ,
1732+ "evaluation_module_error" : self .challenge4 .evaluation_module_error ,
1733+ "ec2_storage" : self .challenge4 .ec2_storage ,
1734+ "ephemeral_storage" : self .challenge4 .ephemeral_storage ,
1735+ "worker_image_url" : self .challenge4 .worker_image_url ,
1736+ "worker_instance_type" : self .challenge4 .worker_instance_type ,
1737+ "sqs_retention_period" : self .challenge4 .sqs_retention_period ,
1738+ "github_repository" : self .challenge4 .github_repository ,
17261739 },
17271740 {
17281741 "id" : self .challenge3 .pk ,
@@ -1790,6 +1803,7 @@ def test_get_all_challenges(self):
17901803 "worker_image_url" : self .challenge3 .worker_image_url ,
17911804 "worker_instance_type" : self .challenge3 .worker_instance_type ,
17921805 "sqs_retention_period" : self .challenge3 .sqs_retention_period ,
1806+ "github_repository" : self .challenge3 .github_repository ,
17931807 },
17941808 {
17951809 "id" : self .challenge2 .pk ,
@@ -1857,6 +1871,7 @@ def test_get_all_challenges(self):
18571871 "worker_image_url" : self .challenge2 .worker_image_url ,
18581872 "worker_instance_type" : self .challenge2 .worker_instance_type ,
18591873 "sqs_retention_period" : self .challenge2 .sqs_retention_period ,
1874+ "github_repository" : self .challenge2 .github_repository ,
18601875 },
18611876 ]
18621877 response = self .client .get (self .url , {}, format = "json" )
@@ -1925,6 +1940,7 @@ def setUp(self):
19251940 start_date = timezone .now () - timedelta (days = 2 ),
19261941 end_date = timezone .now () - timedelta (days = 1 ),
19271942 featured = True ,
1943+ github_repository = "challenge3/github_repo" ,
19281944 )
19291945
19301946 def test_get_featured_challenges (self ):
@@ -1995,6 +2011,7 @@ def test_get_featured_challenges(self):
19952011 "worker_image_url" : self .challenge3 .worker_image_url ,
19962012 "worker_instance_type" : self .challenge3 .worker_instance_type ,
19972013 "sqs_retention_period" : self .challenge3 .sqs_retention_period ,
2014+ "github_repository" : self .challenge3 .github_repository ,
19982015 }
19992016 ]
20002017 response = self .client .get (self .url , {}, format = "json" )
@@ -2036,6 +2053,7 @@ def setUp(self):
20362053 start_date = timezone .now () - timedelta (days = 2 ),
20372054 end_date = timezone .now () + timedelta (days = 1 ),
20382055 approved_by_admin = False ,
2056+ github_repository = "challenge3/github_repo" ,
20392057 )
20402058
20412059 self .challenge4 = Challenge .objects .create (
@@ -2057,6 +2075,7 @@ def setUp(self):
20572075 end_date = timezone .now () + timedelta (days = 1 ),
20582076 is_disabled = False ,
20592077 approved_by_admin = True ,
2078+ github_repository = "challenge4/github_repo" ,
20602079 )
20612080
20622081 self .challenge5 = Challenge .objects .create (
@@ -2157,6 +2176,7 @@ def test_get_challenge_by_pk_when_user_is_challenge_host(self):
21572176 "worker_image_url" : self .challenge3 .worker_image_url ,
21582177 "worker_instance_type" : self .challenge3 .worker_instance_type ,
21592178 "sqs_retention_period" : self .challenge3 .sqs_retention_period ,
2179+ "github_repository" : self .challenge3 .github_repository ,
21602180 }
21612181
21622182 response = self .client .get (self .url , {})
@@ -2248,6 +2268,7 @@ def test_get_challenge_by_pk_when_user_is_participant(self):
22482268 "worker_image_url" : self .challenge4 .worker_image_url ,
22492269 "worker_instance_type" : self .challenge4 .worker_instance_type ,
22502270 "sqs_retention_period" : self .challenge4 .sqs_retention_period ,
2271+ "github_repository" : self .challenge4 .github_repository ,
22512272 }
22522273
22532274 self .client .force_authenticate (user = self .user1 )
@@ -2297,6 +2318,7 @@ def setUp(self):
22972318 start_date = timezone .now () - timedelta (days = 2 ),
22982319 end_date = timezone .now () + timedelta (days = 1 ),
22992320 approved_by_admin = True ,
2321+ github_repository = "challenge/github_repo" ,
23002322 )
23012323
23022324 self .challenge2 = Challenge .objects .create (
@@ -2315,6 +2337,7 @@ def setUp(self):
23152337 start_date = timezone .now () - timedelta (days = 2 ),
23162338 end_date = timezone .now () + timedelta (days = 1 ),
23172339 approved_by_admin = True ,
2340+ github_repository = "challenge2/github_repo" ,
23182341 )
23192342
23202343 self .participant_team2 = ParticipantTeam .objects .create (
@@ -2399,6 +2422,7 @@ def test_get_challenge_when_host_team_is_given(self):
23992422 "worker_image_url" : self .challenge2 .worker_image_url ,
24002423 "worker_instance_type" : self .challenge2 .worker_instance_type ,
24012424 "sqs_retention_period" : self .challenge2 .sqs_retention_period ,
2425+ "github_repository" : self .challenge2 .github_repository ,
24022426 }
24032427 ]
24042428
@@ -2478,6 +2502,7 @@ def test_get_challenge_when_participant_team_is_given(self):
24782502 "worker_image_url" : self .challenge2 .worker_image_url ,
24792503 "worker_instance_type" : self .challenge2 .worker_instance_type ,
24802504 "sqs_retention_period" : self .challenge2 .sqs_retention_period ,
2505+ "github_repository" : self .challenge2 .github_repository ,
24812506 }
24822507 ]
24832508
@@ -2557,6 +2582,7 @@ def test_get_challenge_when_mode_is_participant(self):
25572582 "worker_image_url" : self .challenge2 .worker_image_url ,
25582583 "worker_instance_type" : self .challenge2 .worker_instance_type ,
25592584 "sqs_retention_period" : self .challenge2 .sqs_retention_period ,
2585+ "github_repository" : self .challenge2 .github_repository ,
25602586 }
25612587 ]
25622588
@@ -2634,6 +2660,7 @@ def test_get_challenge_when_mode_is_host(self):
26342660 "worker_image_url" : self .challenge .worker_image_url ,
26352661 "worker_instance_type" : self .challenge .worker_instance_type ,
26362662 "sqs_retention_period" : self .challenge .sqs_retention_period ,
2663+ "github_repository" : self .challenge .github_repository ,
26372664 },
26382665 {
26392666 "id" : self .challenge2 .pk ,
@@ -2701,6 +2728,7 @@ def test_get_challenge_when_mode_is_host(self):
27012728 "worker_image_url" : self .challenge2 .worker_image_url ,
27022729 "worker_instance_type" : self .challenge2 .worker_instance_type ,
27032730 "sqs_retention_period" : self .challenge2 .sqs_retention_period ,
2731+ "github_repository" : self .challenge2 .github_repository ,
27042732 },
27052733 ]
27062734
0 commit comments