Commit 4f23c31d by Renzo Lucioni

Fix intermittent failures in bok-choy tests of payment and verification

parent 6604eedb
......@@ -245,7 +245,7 @@ def create_mode(request, course_id):
Args:
request (`Request`): The Django Request object.
course_id (unicode): The slash-separated course key.
course_id (unicode): A course ID.
Returns:
Response
......@@ -267,7 +267,7 @@ def create_mode(request, course_id):
CourseMode.objects.get_or_create(course_id=course_key, **PARAMETERS)
# Return a success message and a 200 response
return HttpResponse("Mode '{mode_slug}' created for course with ID '{course_id}'.".format(
return HttpResponse("Mode '{mode_slug}' created for '{course}'.".format(
mode_slug=PARAMETERS['mode_slug'],
course_id=course_id
course=course_id
))
......@@ -33,7 +33,7 @@ class ModeCreationPage(PageObject):
"""
super(ModeCreationPage, self).__init__(browser)
self.course_id = course_id
self._course_id = course_id
self._parameters = {}
if mode_slug is not None:
......@@ -54,9 +54,9 @@ class ModeCreationPage(PageObject):
@property
def url(self):
"""Construct the mode creation URL."""
url = '{base}/course_modes/create_mode/{course_id}'.format(
url = '{base}/course_modes/create_mode/{course_id}/'.format(
base=BASE_URL,
course_id=self.course_id
course_id=self._course_id
)
query_string = urllib.urlencode(self._parameters)
......@@ -67,5 +67,5 @@ class ModeCreationPage(PageObject):
def is_browser_on_page(self):
message = self.q(css='BODY').text[0]
match = re.search(r'Mode ([^$]+) created for course with ID ([^$]+).$', message)
match = re.search(r'Mode ([^$]+) created for ([^$]+).$', message)
return True if match else False
......@@ -37,7 +37,7 @@ class TrackSelectionPage(PageObject):
@property
def url(self):
"""Return the URL corresponding to the track selection page."""
url = "{base}/course_modes/choose/{course_id}{querystring}".format(
url = "{base}/course_modes/choose/{course_id}/{querystring}".format(
base=BASE_URL,
course_id=self._course_id,
querystring=self._querystring
......
......@@ -242,7 +242,6 @@ class RegisterFromCombinedPageTest(UniqueCourseTest):
self.assertEqual(self.register_page.current_form, "login")
@skip('ECOM-956: Failing intermittently due to 500 errors when trying to hit the mode creation endpoint.')
@attr('shard_1')
class PayAndVerifyTest(UniqueCourseTest):
"""Test that we can proceed through the payment and verification flow."""
......@@ -253,6 +252,7 @@ class PayAndVerifyTest(UniqueCourseTest):
create a user and log them in.
"""
super(PayAndVerifyTest, self).setUp()
self.track_selection_page = TrackSelectionPage(self.browser, self.course_id, separate_verified=True)
self.payment_and_verification_flow = PaymentAndVerificationFlow(self.browser, self.course_id)
self.immediate_verification_page = PaymentAndVerificationFlow(self.browser, self.course_id, entry_point='verify-now')
......
......@@ -78,6 +78,7 @@
"SUBDOMAIN_BRANDING": false,
"SUBDOMAIN_COURSE_LISTINGS": false,
"ALLOW_AUTOMATED_SIGNUPS": true,
"AUTOMATIC_AUTH_FOR_TESTING": true,
"MODE_CREATION_FOR_TESTING": true,
"AUTOMATIC_VERIFY_STUDENT_IDENTITY_FOR_TESTING": true
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment