@@ -205,14 +205,11 @@ def test_get_challenge(self):
205205 "worker_instance_type" : self .challenge .worker_instance_type ,
206206 "sqs_retention_period" : self .challenge .sqs_retention_period ,
207207 "github_repository" : self .challenge .github_repository ,
208- "github_branch" : self .challenge .github_branch ,
209208 }
210209 ]
211210
212211 response = self .client .get (self .url , {})
213- self .assertEqual (
214- response .data ["results" ], json .loads (json .dumps (expected ))
215- )
212+ self .assertEqual (response .data ["results" ], expected )
216213 self .assertEqual (response .status_code , status .HTTP_200_OK )
217214
218215 def test_particular_challenge_host_team_for_challenge_does_not_exist (self ):
@@ -580,7 +577,6 @@ def test_get_particular_challenge(self):
580577 "worker_instance_type" : self .challenge .worker_instance_type ,
581578 "sqs_retention_period" : self .challenge .sqs_retention_period ,
582579 "github_repository" : self .challenge .github_repository ,
583- "github_branch" : self .challenge .github_branch ,
584580 }
585581 response = self .client .get (self .url , {})
586582 self .assertEqual (response .data , expected )
@@ -684,7 +680,6 @@ def test_update_challenge_when_user_is_its_creator(self):
684680 "worker_instance_type" : self .challenge .worker_instance_type ,
685681 "sqs_retention_period" : self .challenge .sqs_retention_period ,
686682 "github_repository" : self .challenge .github_repository ,
687- "github_branch" : self .challenge .github_branch ,
688683 }
689684 response = self .client .put (
690685 self .url , {"title" : new_title , "description" : new_description }
@@ -814,7 +809,6 @@ def test_particular_challenge_partial_update(self):
814809 "worker_instance_type" : self .challenge .worker_instance_type ,
815810 "sqs_retention_period" : self .challenge .sqs_retention_period ,
816811 "github_repository" : self .challenge .github_repository ,
817- "github_branch" : self .challenge .github_branch ,
818812 }
819813 response = self .client .patch (self .url , self .partial_update_data )
820814 self .assertEqual (response .data , expected )
@@ -893,7 +887,6 @@ def test_particular_challenge_update(self):
893887 "worker_instance_type" : self .challenge .worker_instance_type ,
894888 "sqs_retention_period" : self .challenge .sqs_retention_period ,
895889 "github_repository" : self .challenge .github_repository ,
896- "github_branch" : self .challenge .github_branch ,
897890 }
898891 response = self .client .put (self .url , self .data )
899892 self .assertEqual (response .data , expected )
@@ -1491,7 +1484,6 @@ def test_get_past_challenges(self):
14911484 "worker_instance_type" : self .challenge3 .worker_instance_type ,
14921485 "sqs_retention_period" : self .challenge3 .sqs_retention_period ,
14931486 "github_repository" : self .challenge3 .github_repository ,
1494- "github_branch" : self .challenge3 .github_branch ,
14951487 }
14961488 ]
14971489 response = self .client .get (self .url , {}, format = "json" )
@@ -1576,7 +1568,6 @@ def test_get_present_challenges(self):
15761568 "worker_instance_type" : self .challenge2 .worker_instance_type ,
15771569 "sqs_retention_period" : self .challenge2 .sqs_retention_period ,
15781570 "github_repository" : self .challenge2 .github_repository ,
1579- "github_branch" : self .challenge2 .github_branch ,
15801571 }
15811572 ]
15821573 response = self .client .get (self .url , {}, format = "json" )
@@ -1661,7 +1652,6 @@ def test_get_future_challenges(self):
16611652 "worker_instance_type" : self .challenge4 .worker_instance_type ,
16621653 "sqs_retention_period" : self .challenge4 .sqs_retention_period ,
16631654 "github_repository" : self .challenge4 .github_repository ,
1664- "github_branch" : self .challenge4 .github_branch ,
16651655 }
16661656 ]
16671657 response = self .client .get (self .url , {}, format = "json" )
@@ -1746,7 +1736,6 @@ def test_get_all_challenges(self):
17461736 "worker_instance_type" : self .challenge4 .worker_instance_type ,
17471737 "sqs_retention_period" : self .challenge4 .sqs_retention_period ,
17481738 "github_repository" : self .challenge4 .github_repository ,
1749- "github_branch" : self .challenge4 .github_branch ,
17501739 },
17511740 {
17521741 "id" : self .challenge3 .pk ,
@@ -1815,7 +1804,6 @@ def test_get_all_challenges(self):
18151804 "worker_instance_type" : self .challenge3 .worker_instance_type ,
18161805 "sqs_retention_period" : self .challenge3 .sqs_retention_period ,
18171806 "github_repository" : self .challenge3 .github_repository ,
1818- "github_branch" : self .challenge3 .github_branch ,
18191807 },
18201808 {
18211809 "id" : self .challenge2 .pk ,
@@ -1884,7 +1872,6 @@ def test_get_all_challenges(self):
18841872 "worker_instance_type" : self .challenge2 .worker_instance_type ,
18851873 "sqs_retention_period" : self .challenge2 .sqs_retention_period ,
18861874 "github_repository" : self .challenge2 .github_repository ,
1887- "github_branch" : self .challenge2 .github_branch ,
18881875 },
18891876 ]
18901877 response = self .client .get (self .url , {}, format = "json" )
@@ -2025,7 +2012,6 @@ def test_get_featured_challenges(self):
20252012 "worker_instance_type" : self .challenge3 .worker_instance_type ,
20262013 "sqs_retention_period" : self .challenge3 .sqs_retention_period ,
20272014 "github_repository" : self .challenge3 .github_repository ,
2028- "github_branch" : self .challenge3 .github_branch ,
20292015 }
20302016 ]
20312017 response = self .client .get (self .url , {}, format = "json" )
@@ -2191,7 +2177,6 @@ def test_get_challenge_by_pk_when_user_is_challenge_host(self):
21912177 "worker_instance_type" : self .challenge3 .worker_instance_type ,
21922178 "sqs_retention_period" : self .challenge3 .sqs_retention_period ,
21932179 "github_repository" : self .challenge3 .github_repository ,
2194- "github_branch" : self .challenge3 .github_branch ,
21952180 }
21962181
21972182 response = self .client .get (self .url , {})
@@ -2284,7 +2269,6 @@ def test_get_challenge_by_pk_when_user_is_participant(self):
22842269 "worker_instance_type" : self .challenge4 .worker_instance_type ,
22852270 "sqs_retention_period" : self .challenge4 .sqs_retention_period ,
22862271 "github_repository" : self .challenge4 .github_repository ,
2287- "github_branch" : self .challenge4 .github_branch ,
22882272 }
22892273
22902274 self .client .force_authenticate (user = self .user1 )
@@ -2439,7 +2423,6 @@ def test_get_challenge_when_host_team_is_given(self):
24392423 "worker_instance_type" : self .challenge2 .worker_instance_type ,
24402424 "sqs_retention_period" : self .challenge2 .sqs_retention_period ,
24412425 "github_repository" : self .challenge2 .github_repository ,
2442- "github_branch" : self .challenge2 .github_branch ,
24432426 }
24442427 ]
24452428
@@ -2520,7 +2503,6 @@ def test_get_challenge_when_participant_team_is_given(self):
25202503 "worker_instance_type" : self .challenge2 .worker_instance_type ,
25212504 "sqs_retention_period" : self .challenge2 .sqs_retention_period ,
25222505 "github_repository" : self .challenge2 .github_repository ,
2523- "github_branch" : self .challenge2 .github_branch ,
25242506 }
25252507 ]
25262508
@@ -2601,7 +2583,6 @@ def test_get_challenge_when_mode_is_participant(self):
26012583 "worker_instance_type" : self .challenge2 .worker_instance_type ,
26022584 "sqs_retention_period" : self .challenge2 .sqs_retention_period ,
26032585 "github_repository" : self .challenge2 .github_repository ,
2604- "github_branch" : self .challenge2 .github_branch ,
26052586 }
26062587 ]
26072588
@@ -2680,7 +2661,6 @@ def test_get_challenge_when_mode_is_host(self):
26802661 "worker_instance_type" : self .challenge .worker_instance_type ,
26812662 "sqs_retention_period" : self .challenge .sqs_retention_period ,
26822663 "github_repository" : self .challenge .github_repository ,
2683- "github_branch" : self .challenge .github_branch ,
26842664 },
26852665 {
26862666 "id" : self .challenge2 .pk ,
@@ -2749,7 +2729,6 @@ def test_get_challenge_when_mode_is_host(self):
27492729 "worker_instance_type" : self .challenge2 .worker_instance_type ,
27502730 "sqs_retention_period" : self .challenge2 .sqs_retention_period ,
27512731 "github_repository" : self .challenge2 .github_repository ,
2752- "github_branch" : self .challenge2 .github_branch ,
27532732 },
27542733 ]
27552734
@@ -5932,7 +5911,6 @@ def test_create_challenge_using_github_success(self):
59325911 self .url ,
59335912 {
59345913 "GITHUB_REPOSITORY" : "https://github.com/yourusername/repository" ,
5935- "GITHUB_BRANCH_NAME" : "refs/heads/challenge" ,
59365914 "zip_configuration" : self .input_zip_file ,
59375915 },
59385916 format = "multipart" ,
@@ -5948,14 +5926,6 @@ def test_create_challenge_using_github_success(self):
59485926 self .assertEqual (Leaderboard .objects .count (), 1 )
59495927 self .assertEqual (ChallengePhaseSplit .objects .count (), 1 )
59505928
5951- # Verify github_branch is properly stored
5952- challenge = Challenge .objects .first ()
5953- self .assertEqual (
5954- challenge .github_repository ,
5955- "https://github.com/yourusername/repository" ,
5956- )
5957- self .assertEqual (challenge .github_branch , "refs/heads/challenge" )
5958-
59595929 def test_create_challenge_using_github_when_challenge_host_team_does_not_exist (
59605930 self ,
59615931 ):
@@ -5994,40 +5964,6 @@ def test_create_challenge_using_github_when_user_is_not_authenticated(
59945964 self .assertEqual (list (response .data .values ())[0 ], expected ["error" ])
59955965 self .assertEqual (response .status_code , status .HTTP_401_UNAUTHORIZED )
59965966
5997- def test_create_challenge_using_github_without_branch_name (self ):
5998- self .url = reverse_lazy (
5999- "challenges:create_or_update_github_challenge" ,
6000- kwargs = {"challenge_host_team_pk" : self .challenge_host_team .pk },
6001- )
6002-
6003- with mock .patch ("challenges.views.requests.get" ) as m :
6004- resp = mock .Mock ()
6005- resp .content = self .test_zip_file .read ()
6006- resp .status_code = 200
6007- m .return_value = resp
6008- response = self .client .post (
6009- self .url ,
6010- {
6011- "GITHUB_REPOSITORY" : "https://github.com/yourusername/repository" ,
6012- "zip_configuration" : self .input_zip_file ,
6013- },
6014- format = "multipart" ,
6015- )
6016- expected = {
6017- "Success" : "Challenge Challenge Title has been created successfully and sent for review to EvalAI Admin."
6018- }
6019-
6020- self .assertEqual (response .status_code , 201 )
6021- self .assertEqual (response .json (), expected )
6022-
6023- # Verify github_branch defaults to empty string when not provided
6024- challenge = Challenge .objects .first ()
6025- self .assertEqual (
6026- challenge .github_repository ,
6027- "https://github.com/yourusername/repository" ,
6028- )
6029- self .assertEqual (challenge .github_branch , "" )
6030-
60315967
60325968class ValidateChallengeTest (APITestCase ):
60335969 def setUp (self ):
@@ -6094,7 +6030,6 @@ def test_validate_challenge_using_success(self):
60946030 self .url ,
60956031 {
60966032 "GITHUB_REPOSITORY" : "https://github.com/yourusername/repository" ,
6097- "GITHUB_BRANCH_NAME" : "refs/heads/challenge" ,
60986033 "zip_configuration" : self .input_zip_file ,
60996034 },
61006035 format = "multipart" ,
0 commit comments