@@ -879,7 +879,7 @@ def test_get_or_create_student_item_race_condition__item_not_created(self):
879879 api ._get_or_create_student_item (STUDENT_ITEM ) # pylint: disable=protected-access
880880
881881 def test_create_external_grader_detail (self ):
882- external_grader_detail_data = {'queue_name' : 'test_queue' }
882+ external_grader_detail_data = {'queue_name' : 'test_queue' , 'queue_key' : 'test_key' }
883883 external_grader_detail = api .create_external_grader_detail (STUDENT_ITEM , ANSWER_ONE ,
884884 ** external_grader_detail_data )
885885
@@ -890,11 +890,11 @@ def test_create_external_grader_detail(self):
890890 self .assertEqual (external_grader_detail .queue_name , 'test_queue' )
891891
892892 def test_create_multiple_external_grader_detail (self ):
893- external_grader_detail_data1 = {'queue_name' : 'test_queue' }
893+ external_grader_detail_data1 = {'queue_name' : 'test_queue' , 'queue_key' : 'test_key' }
894894 external_grader_detail1 = api .create_external_grader_detail (STUDENT_ITEM , ANSWER_ONE ,
895895 ** external_grader_detail_data1 )
896896
897- external_grader_detail_data2 = {'queue_name' : 'test_queue' }
897+ external_grader_detail_data2 = {'queue_name' : 'test_queue' , 'queue_key' : 'test_key' }
898898 external_grader_detail2 = api .create_external_grader_detail (SECOND_STUDENT_ITEM , ANSWER_ONE ,
899899 ** external_grader_detail_data2 )
900900
@@ -917,13 +917,18 @@ def test_create_external_grader_detail_directly_database_error(self):
917917 mock_create .side_effect = DatabaseError ("Database connection failed" )
918918
919919 with self .assertRaises (api .SubmissionInternalError ):
920- api .create_external_grader_detail (STUDENT_ITEM , ANSWER_ONE , queue_name = "test_queue" )
920+ api .create_external_grader_detail (
921+ STUDENT_ITEM , ANSWER_ONE , queue_name = "test_queue" , queue_key = "test_key"
922+ )
921923
922924 def test_create_multiple_submission_external_grader_details (self ):
923- external_grader_detail1 = api .create_external_grader_detail (STUDENT_ITEM , ANSWER_ONE , queue_name = "shared_queue" )
925+ external_grader_detail1 = api .create_external_grader_detail (
926+ STUDENT_ITEM , ANSWER_ONE , queue_name = "shared_queue" , queue_key = "test_key"
927+ )
924928
925- external_grader_detail2 = api .create_external_grader_detail (SECOND_STUDENT_ITEM , ANSWER_TWO ,
926- queue_name = "shared_queue" )
929+ external_grader_detail2 = api .create_external_grader_detail (
930+ SECOND_STUDENT_ITEM , ANSWER_TWO , queue_name = "shared_queue" , queue_key = "test_key"
931+ )
927932
928933 submission1 = Submission .objects .get (uuid = external_grader_detail1 .submission .uuid )
929934 self .assertEqual (external_grader_detail1 .queue_name , 'shared_queue' )
@@ -950,6 +955,7 @@ def __init__(self, file_content):
950955
951956 event_data = {
952957 'queue_name' : 'test_queue' ,
958+ 'queue_key' : 'test_key' ,
953959 'files' : {'test.txt' : test_file }
954960 }
955961
@@ -978,6 +984,7 @@ def __init__(self, filename, content):
978984
979985 external_grader_detail = {
980986 'queue_name' : 'test_queue' ,
987+ 'queue_key' : 'test_key' ,
981988 'files' : test_files
982989 }
983990 external_grader_detail = api .create_external_grader_detail (STUDENT_ITEM , ANSWER_ONE , ** external_grader_detail )
@@ -988,7 +995,9 @@ def __init__(self, filename, content):
988995
989996 def test_create_external_grader_detail_without_files (self ):
990997 """Test creating a queue record without any files still works."""
991- external_grader_instance = api .create_external_grader_detail (STUDENT_ITEM , ANSWER_ONE , queue_name = "test_queue" )
998+ external_grader_instance = api .create_external_grader_detail (
999+ STUDENT_ITEM , ANSWER_ONE , queue_name = "test_queue" , queue_key = "test_key"
1000+ )
9921001 self .assertEqual (external_grader_instance .queue_name , 'test_queue' )
9931002 self .assertEqual (external_grader_instance .files .count (), 0 )
9941003
@@ -1008,6 +1017,7 @@ def setUp(self):
10081017 }
10091018 self .answer = "test answer"
10101019 self .queue_name = "test_queue"
1020+ self .queue_key = "test_key"
10111021
10121022 def test_create_external_grader_with_files (self ):
10131023 """Test processing files within create_external_grader_detail."""
@@ -1024,6 +1034,7 @@ def __init__(self):
10241034 student_item_dict = self .student_item_dict ,
10251035 answer = self .answer ,
10261036 queue_name = self .queue_name ,
1037+ queue_key = self .queue_key ,
10271038 files = files_dict
10281039 )
10291040
@@ -1046,6 +1057,7 @@ def __init__(self):
10461057 student_item_dict = self .student_item_dict ,
10471058 answer = self .answer ,
10481059 queue_name = self .queue_name ,
1060+ queue_key = self .queue_key ,
10491061 files = {"test.txt" : FileObjWithFileAttr ()}
10501062 )
10511063
@@ -1076,6 +1088,7 @@ def __init__(self):
10761088 student_item_dict = self .student_item_dict ,
10771089 answer = self .answer ,
10781090 queue_name = self .queue_name ,
1091+ queue_key = self .queue_key ,
10791092 files = files_dict
10801093 )
10811094
@@ -1105,6 +1118,7 @@ def __init__(self):
11051118 student_item_dict = self .student_item_dict ,
11061119 answer = self .answer ,
11071120 queue_name = self .queue_name ,
1121+ queue_key = self .queue_key ,
11081122 files = files_dict
11091123 )
11101124
0 commit comments