|
7 | 7 |
|
8 | 8 | from datetime import timedelta |
9 | 9 | from mock import Mock, PropertyMock, patch |
| 10 | +from six import text_type |
10 | 11 |
|
11 | 12 | from django.utils import timezone |
12 | 13 |
|
@@ -153,30 +154,32 @@ def test_get_signed_lti_parameters(self): |
153 | 154 | self.lti_consumer.xblock.graceperiod = timedelta(days=1) |
154 | 155 |
|
155 | 156 | expected_lti_parameters = { |
156 | | - u'user_id': self.lti_consumer.xblock.user_id, |
157 | | - u'oauth_callback': u'about:blank', |
158 | | - u'launch_presentation_return_url': '', |
159 | | - u'lti_message_type': u'basic-lti-launch-request', |
160 | | - u'lti_version': 'LTI-1p0', |
161 | | - u'roles': self.lti_consumer.xblock.role, |
162 | | - u'resource_link_id': self.lti_consumer.xblock.resource_link_id, |
163 | | - u'lis_result_sourcedid': self.lti_consumer.xblock.lis_result_sourcedid, |
164 | | - u'context_id': self.lti_consumer.xblock.context_id, |
165 | | - u'lis_outcome_service_url': self.lti_consumer.xblock.outcome_service_url, |
166 | | - u'custom_component_display_name': self.lti_consumer.xblock.display_name, |
167 | | - u'custom_component_due_date': self.lti_consumer.xblock.due.strftime('%Y-%m-%d %H:%M:%S'), |
168 | | - u'custom_component_graceperiod': str(self.lti_consumer.xblock.graceperiod.total_seconds()), |
| 157 | + text_type('user_id'): self.lti_consumer.xblock.user_id, |
| 158 | + text_type('oauth_callback'): 'about:blank', |
| 159 | + text_type('launch_presentation_return_url'): '', |
| 160 | + text_type('lti_message_type'): 'basic-lti-launch-request', |
| 161 | + text_type('lti_version'): 'LTI-1p0', |
| 162 | + text_type('roles'): self.lti_consumer.xblock.role, |
| 163 | + text_type('resource_link_id'): self.lti_consumer.xblock.resource_link_id, |
| 164 | + text_type('lis_result_sourcedid'): self.lti_consumer.xblock.lis_result_sourcedid, |
| 165 | + text_type('context_id'): self.lti_consumer.xblock.context_id, |
| 166 | + text_type('lis_outcome_service_url'): self.lti_consumer.xblock.outcome_service_url, |
| 167 | + text_type('custom_component_display_name'): self.lti_consumer.xblock.display_name, |
| 168 | + text_type('custom_component_due_date'): self.lti_consumer.xblock.due.strftime('%Y-%m-%d %H:%M:%S'), |
| 169 | + text_type('custom_component_graceperiod'): str(self.lti_consumer.xblock.graceperiod.total_seconds()), |
169 | 170 | 'lis_person_sourcedid': 'edx', |
170 | 171 | 'lis_person_contact_email_primary': 'edx@example.com', |
171 | 172 | 'launch_presentation_locale': 'en', |
172 | | - u'custom_param_1': 'custom1', |
173 | | - u'custom_param_2': 'custom2', |
174 | | - u'oauth_nonce': 'fake_nonce', |
| 173 | + text_type('custom_param_1'): 'custom1', |
| 174 | + text_type('custom_param_2'): 'custom2', |
| 175 | + text_type('oauth_nonce'): 'fake_nonce', |
175 | 176 | 'oauth_timestamp': 'fake_timestamp', |
176 | 177 | 'oauth_version': 'fake_version', |
177 | 178 | 'oauth_signature_method': 'fake_method', |
178 | 179 | 'oauth_consumer_key': 'fake_consumer_key', |
179 | | - 'oauth_signature': u'fake_signature' |
| 180 | + 'oauth_signature': 'fake_signature', |
| 181 | + text_type('context_label'): self.lti_consumer.xblock.course.display_org_with_default, |
| 182 | + text_type('context_title'): self.lti_consumer.xblock.course.display_name_with_default, |
180 | 183 | } |
181 | 184 | self.lti_consumer.xblock.has_score = True |
182 | 185 | self.lti_consumer.xblock.ask_to_send_username = True |
|
0 commit comments