Remove old payment and verification flow
Removes old payment and verification endpoints, views, templates, and tests, making the new split flow the default. The SEPARATE_VERIFICATION_FROM_PAYMENT feature flag is also removed.
This commit is contained in:
@@ -13,32 +13,15 @@ class DashboardPage(PageObject):
|
||||
Student dashboard, where the student can view
|
||||
courses she/he has registered for.
|
||||
"""
|
||||
def __init__(self, browser, separate_verified=False):
|
||||
def __init__(self, browser):
|
||||
"""Initialize the page.
|
||||
|
||||
Arguments:
|
||||
browser (Browser): The browser instance.
|
||||
|
||||
Keyword Arguments:
|
||||
separate_verified (Boolean): Whether to use the split payment and
|
||||
verification flow.
|
||||
"""
|
||||
super(DashboardPage, self).__init__(browser)
|
||||
|
||||
if separate_verified:
|
||||
self._querystring = "?separate-verified=1"
|
||||
else:
|
||||
self._querystring = "?disable-separate-verified=1"
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
"""Return the URL corresponding to the dashboard."""
|
||||
url = "{base}/dashboard{querystring}".format(
|
||||
base=BASE_URL,
|
||||
querystring=self._querystring
|
||||
)
|
||||
|
||||
return url
|
||||
url = "{base}/dashboard".format(base=BASE_URL)
|
||||
|
||||
def is_browser_on_page(self):
|
||||
return self.q(css='section.my-courses').present
|
||||
|
||||
@@ -12,11 +12,7 @@ from .dashboard import DashboardPage
|
||||
class PaymentAndVerificationFlow(PageObject):
|
||||
"""Interact with the split payment and verification flow.
|
||||
|
||||
These pages are currently hidden behind the feature flag
|
||||
`SEPARATE_VERIFICATION_FROM_PAYMENT`, which is enabled in
|
||||
the Bok Choy settings.
|
||||
|
||||
When enabled, the flow can be accessed at the following URLs:
|
||||
The flow can be accessed at the following URLs:
|
||||
`/verify_student/start-flow/{course}/`
|
||||
`/verify_student/upgrade/{course}/`
|
||||
`/verify_student/verify-now/{course}/`
|
||||
@@ -121,7 +117,7 @@ class PaymentAndVerificationFlow(PageObject):
|
||||
else:
|
||||
raise Exception("The dashboard can only be accessed from the enrollment confirmation.")
|
||||
|
||||
DashboardPage(self.browser, separate_verified=True).wait_for_page()
|
||||
DashboardPage(self.browser).wait_for_page()
|
||||
|
||||
|
||||
class FakePaymentPage(PageObject):
|
||||
|
||||
@@ -14,33 +14,22 @@ class TrackSelectionPage(PageObject):
|
||||
|
||||
This page can be accessed at `/course_modes/choose/{course_id}/`.
|
||||
"""
|
||||
def __init__(self, browser, course_id, separate_verified=False):
|
||||
def __init__(self, browser, course_id):
|
||||
"""Initialize the page.
|
||||
|
||||
Arguments:
|
||||
browser (Browser): The browser instance.
|
||||
course_id (unicode): The course in which the user is enrolling.
|
||||
|
||||
Keyword Arguments:
|
||||
separate_verified (Boolean): Whether to use the split payment and
|
||||
verification flow when enrolling as verified.
|
||||
"""
|
||||
super(TrackSelectionPage, self).__init__(browser)
|
||||
self._course_id = course_id
|
||||
self._separate_verified = separate_verified
|
||||
|
||||
if self._separate_verified:
|
||||
self._querystring = "?separate-verified=1"
|
||||
else:
|
||||
self._querystring = "?disable-separate-verified=1"
|
||||
|
||||
@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}/".format(
|
||||
base=BASE_URL,
|
||||
course_id=self._course_id,
|
||||
querystring=self._querystring
|
||||
course_id=self._course_id
|
||||
)
|
||||
|
||||
return url
|
||||
@@ -61,7 +50,7 @@ class TrackSelectionPage(PageObject):
|
||||
if mode == "honor":
|
||||
self.q(css="input[name='honor_mode']").click()
|
||||
|
||||
return DashboardPage(self.browser, separate_verified=self._separate_verified).wait_for_page()
|
||||
return DashboardPage(self.browser).wait_for_page()
|
||||
elif mode == "verified":
|
||||
# Check the first contribution option, then click the enroll button
|
||||
self.q(css=".contribution-option > input").first.click()
|
||||
|
||||
@@ -253,12 +253,12 @@ class PayAndVerifyTest(UniqueCourseTest):
|
||||
"""
|
||||
super(PayAndVerifyTest, self).setUp()
|
||||
|
||||
self.track_selection_page = TrackSelectionPage(self.browser, self.course_id, separate_verified=True)
|
||||
self.track_selection_page = TrackSelectionPage(self.browser, self.course_id)
|
||||
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')
|
||||
self.upgrade_page = PaymentAndVerificationFlow(self.browser, self.course_id, entry_point='upgrade')
|
||||
self.fake_payment_page = FakePaymentPage(self.browser, self.course_id)
|
||||
self.dashboard_page = DashboardPage(self.browser, separate_verified=True)
|
||||
self.dashboard_page = DashboardPage(self.browser)
|
||||
|
||||
# Create a course
|
||||
CourseFixture(
|
||||
@@ -278,7 +278,7 @@ class PayAndVerifyTest(UniqueCourseTest):
|
||||
# Create a user and log them in
|
||||
AutoAuthPage(self.browser).visit()
|
||||
|
||||
# Navigate to the track selection page with the appropriate GET parameter in the URL
|
||||
# Navigate to the track selection page
|
||||
self.track_selection_page.visit()
|
||||
|
||||
# Enter the payment and verification flow by choosing to enroll as verified
|
||||
@@ -304,7 +304,7 @@ class PayAndVerifyTest(UniqueCourseTest):
|
||||
# Submit photos and proceed to the enrollment confirmation step
|
||||
self.payment_and_verification_flow.next_verification_step(self.immediate_verification_page)
|
||||
|
||||
# Navigate to the dashboard with the appropriate GET parameter in the URL
|
||||
# Navigate to the dashboard
|
||||
self.dashboard_page.visit()
|
||||
|
||||
# Expect that we're enrolled as verified in the course
|
||||
@@ -315,7 +315,7 @@ class PayAndVerifyTest(UniqueCourseTest):
|
||||
# Create a user and log them in
|
||||
AutoAuthPage(self.browser).visit()
|
||||
|
||||
# Navigate to the track selection page with the appropriate GET parameter in the URL
|
||||
# Navigate to the track selection page
|
||||
self.track_selection_page.visit()
|
||||
|
||||
# Enter the payment and verification flow by choosing to enroll as verified
|
||||
@@ -327,7 +327,7 @@ class PayAndVerifyTest(UniqueCourseTest):
|
||||
# Submit payment
|
||||
self.fake_payment_page.submit_payment()
|
||||
|
||||
# Navigate to the dashboard with the appropriate GET parameter in the URL
|
||||
# Navigate to the dashboard
|
||||
self.dashboard_page.visit()
|
||||
|
||||
# Expect that we're enrolled as verified in the course
|
||||
@@ -338,7 +338,7 @@ class PayAndVerifyTest(UniqueCourseTest):
|
||||
# Create a user, log them in, and enroll them in the honor mode
|
||||
AutoAuthPage(self.browser, course_id=self.course_id).visit()
|
||||
|
||||
# Navigate to the dashboard with the appropriate GET parameter in the URL
|
||||
# Navigate to the dashboard
|
||||
self.dashboard_page.visit()
|
||||
|
||||
# Expect that we're enrolled as honor in the course
|
||||
@@ -357,7 +357,7 @@ class PayAndVerifyTest(UniqueCourseTest):
|
||||
# Submit payment
|
||||
self.fake_payment_page.submit_payment()
|
||||
|
||||
# Navigate to the dashboard with the appropriate GET parameter in the URL
|
||||
# Navigate to the dashboard
|
||||
self.dashboard_page.visit()
|
||||
|
||||
# Expect that we're enrolled as verified in the course
|
||||
|
||||
Reference in New Issue
Block a user