BOM-894 python3 order mismatch
Python3 arguments have different positions as compared to python2
This commit is contained in:
@@ -8,6 +8,8 @@ import mock
|
||||
|
||||
import ddt
|
||||
import httpretty
|
||||
from six.moves.urllib.parse import parse_qs # pylint: disable=import-error
|
||||
|
||||
from consent.models import DataSharingConsent
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import User
|
||||
@@ -395,15 +397,16 @@ class TestEnterpriseApi(EnterpriseServiceMockMixin, CacheIsolationTestCase):
|
||||
course_id = 'course-v1:edX+DemoX+Demo_Course'
|
||||
return_to = 'info'
|
||||
|
||||
expected_url = (
|
||||
'/enterprise/grant_data_sharing_permissions?course_id=course-v1%3AedX%2BDemoX%2BDemo_'
|
||||
'Course&failure_url=http%3A%2F%2Flocalhost%3A8000%2Fdashboard%3Fconsent_failed%3Dcou'
|
||||
'rse-v1%253AedX%252BDemoX%252BDemo_Course&enterprise_customer_uuid=cf246b88-d5f6-4908'
|
||||
'-a522-fc307e0b0c59&next=http%3A%2F%2Flocalhost%3A8000%2Fcourses%2Fcourse-v1%3AedX%2B'
|
||||
'DemoX%2BDemo_Course%2Finfo'
|
||||
)
|
||||
expected_url_args = {
|
||||
'course_id': ['course-v1:edX+DemoX+Demo_Course'],
|
||||
'failure_url': ['http://localhost:8000/dashboard?consent_failed=course-v1%3AedX%2BDemoX%2BDemo_Course'],
|
||||
'enterprise_customer_uuid': ['cf246b88-d5f6-4908-a522-fc307e0b0c59'],
|
||||
'next': ['http://localhost:8000/courses/course-v1:edX+DemoX+Demo_Course/info']
|
||||
}
|
||||
|
||||
actual_url = get_enterprise_consent_url(request_mock, course_id, return_to=return_to)
|
||||
self.assertEqual(actual_url, expected_url)
|
||||
actual_url_args = parse_qs(actual_url.split('/enterprise/grant_data_sharing_permissions?')[1])
|
||||
self.assertEqual(actual_url_args, expected_url_args)
|
||||
|
||||
@ddt.data(
|
||||
(False, {'real': 'enterprise', 'uuid': ''}, 'course', [], [], "", ""),
|
||||
|
||||
Reference in New Issue
Block a user