Commit 866ddc22 by Awais

ECOM-528 refactor the code.

parent 7eb8195c
...@@ -162,8 +162,6 @@ class TestRecentEnrollments(ModuleStoreTestCase): ...@@ -162,8 +162,6 @@ class TestRecentEnrollments(ModuleStoreTestCase):
) )
@ddt.unpack @ddt.unpack
def test_donate_button(self, course_modes, enrollment_mode, show_donate): def test_donate_button(self, course_modes, enrollment_mode, show_donate):
from nose.tools import set_trace;
set_trace()
# Enable the enrollment success message # Enable the enrollment success message
self._configure_message_timeout(10000) self._configure_message_timeout(10000)
......
...@@ -758,15 +758,12 @@ def _allow_donation(course_modes, course_id, enrollment): ...@@ -758,15 +758,12 @@ def _allow_donation(course_modes, course_id, enrollment):
True if the course is allowing donations. True if the course is allowing donations.
""" """
# from nose.tools import set_trace;
# set_trace()
donations_enabled = DonationConfiguration.current().enabled donations_enabled = DonationConfiguration.current().enabled
is_verified_mode = CourseMode.has_verified_mode(course_modes[course_id]) is_verified_mode = CourseMode.has_verified_mode(course_modes[course_id])
has_payment_option = CourseMode.has_payment_options(course_id) has_payment_option = CourseMode.has_payment_options(course_id)
return_val = False return_val = False
if donations_enabled: if donations_enabled:
if not is_verified_mode: if not (is_verified_mode and has_payment_option):
if not has_payment_option:
return_val = True return_val = True
else: else:
if enrollment.mode in ['audit', 'honor']: if enrollment.mode in ['audit', 'honor']:
......
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