@@ -1087,6 +1087,19 @@ def test_generate_launch_request(self, message_type, mock_get_data_from_cache):
10871087 for claim in expected_claims .items ():
10881088 self .assertIn (claim , decoded_token_claims )
10891089
1090+ @patch ('lti_consumer.lti_1p3.consumer.get_data_from_cache' )
1091+ def test_generate_basic_launch_request (self , mock_get_data_from_cache ):
1092+ mock_launch_data = self .get_launch_data (message_type = "LtiResourceLinkRequest" )
1093+ mock_get_data_from_cache .return_value = mock_launch_data
1094+
1095+ self ._setup_proctoring ()
1096+ token = self .lti_consumer .generate_launch_request (
1097+ self .preflight_response ,
1098+ )['id_token' ]
1099+
1100+ # just check token is valid
1101+ self .lti_consumer .key_handler .validate_and_decode (token )
1102+
10901103 @patch ('lti_consumer.lti_1p3.consumer.get_data_from_cache' )
10911104 def test_enable_assessment_control (self , mock_get_data_from_cache ):
10921105 """
@@ -1120,11 +1133,11 @@ def test_enable_assessment_control(self, mock_get_data_from_cache):
11201133 @patch ('lti_consumer.lti_1p3.consumer.get_data_from_cache' )
11211134 def test_generate_launch_request_invalid_message (self , mock_get_data_from_cache ):
11221135 """
1123- Ensures that a ValueError is raised if the launch_data.message_type is not LtiStartProctoring or
1124- LtiEndAssessment.
1136+ Ensures that a ValueError is raised if the launch_data.message_type is not LtiStartProctoring,
1137+ LtiEndAssessment, or LtiResourceLinkRequest .
11251138 """
11261139
1127- mock_launch_data = self .get_launch_data (message_type = "LtiResourceLinkRequest " )
1140+ mock_launch_data = self .get_launch_data (message_type = "LtiDeepLinkingRequest " )
11281141 mock_get_data_from_cache .return_value = mock_launch_data
11291142
11301143 self ._setup_proctoring ()
0 commit comments