def test_get_custom_cb_force_login_returns_true_and_is_case_insensitive( self): self.assertTrue( fields.get_custom_cb_force_login({ fields.CUSTOM_CB_FORCE_LOGIN: '******'})) self.assertTrue( fields.get_custom_cb_force_login({ fields.CUSTOM_CB_FORCE_LOGIN: '******'}))
def test_get_custom_cb_force_login_returns_false_for_other_values(self): self.assertFalse( fields.get_custom_cb_force_login( {fields.CUSTOM_CB_FORCE_LOGIN: '******'}))
def test_get_custom_cb_force_login_returns_false_if_missing(self): self.assertFalse(fields.get_custom_cb_force_login({}))
public_message=public_message) return if expected_signature != request_signature: public_message = ( 'Unable to process LTI request; signature mismatch') private_message = '%s. Ours: %s; theirs: %s' % ( public_message, expected_signature, request_signature) self._handle_error(400, private_message, public_message=public_message) return if self._needs_login( runtime.get_course_browsable(), runtime.get_current_user(), fields.get_custom_cb_force_login(self.request.POST)): self.redirect( self._get_login_redirect_url(runtime.get_base_url(), return_url)) return self._DISPATCHER.dispatch(self, runtime, cb_resource) def _get_provider_enabled_field(unused_course): provider_enabled_name = '%s:%s:%s' % (_CONFIG_KEY_COURSE, _CONFIG_KEY_LTI1, _CONFIG_KEY_PROVIDER_ENABLED) return schema_fields.SchemaField( provider_enabled_name, 'Enable LTI Provider', 'boolean',