Commit 12ffe180 by stephensanchez

Pull Request comments addressed. Tests fixed.

parent 0c6b3ba0
...@@ -9,6 +9,7 @@ from opaque_keys.edx import locator ...@@ -9,6 +9,7 @@ from opaque_keys.edx import locator
from pytz import UTC from pytz import UTC
import unittest import unittest
import ddt import ddt
from shoppingcart.models import DonationConfiguration
from student.tests.factories import UserFactory from student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
...@@ -124,7 +125,7 @@ class TestRecentEnrollments(ModuleStoreTestCase): ...@@ -124,7 +125,7 @@ class TestRecentEnrollments(ModuleStoreTestCase):
self._configure_message_timeout(600) self._configure_message_timeout(600)
self.client.login(username=self.student.username, password=self.PASSWORD) self.client.login(username=self.student.username, password=self.PASSWORD)
response = self.client.get(reverse("dashboard")) response = self.client.get(reverse("dashboard"))
self.assertContains(response, "You have successfully enrolled in") self.assertContains(response, "Thank you for enrolling in")
@ddt.data( @ddt.data(
(['audit', 'honor', 'verified'], False), (['audit', 'honor', 'verified'], False),
...@@ -139,6 +140,9 @@ class TestRecentEnrollments(ModuleStoreTestCase): ...@@ -139,6 +140,9 @@ class TestRecentEnrollments(ModuleStoreTestCase):
# Enable the enrollment success message # Enable the enrollment success message
self._configure_message_timeout(10000) self._configure_message_timeout(10000)
# Enable donations
DonationConfiguration(enabled=True).save()
# Create the course mode(s) # Create the course mode(s)
for mode in course_modes: for mode in course_modes:
CourseModeFactory(mode_slug=mode, course_id=self.course.id) CourseModeFactory(mode_slug=mode, course_id=self.course.id)
......
...@@ -100,7 +100,7 @@ var edx = edx || {}; ...@@ -100,7 +100,7 @@ var edx = edx || {};
var html = _.template($("#donation-tpl").html(), {}); var html = _.template($("#donation-tpl").html(), {});
this.$el.html(html); this.$el.html(html);
this.$amount = $("input[name=\"amount\"]", this.$el); this.$amount = $("input[name=\"amount\"]", this.$el);
this.$submit = $("button[type=\"submit\"]", this.$el); this.$submit = $(".action-donate", this.$el);
this.$errorMsg = $(".donation-error-msg", this.$el); this.$errorMsg = $(".donation-error-msg", this.$el);
this.$paymentForm = $(".payment-form", this.$el); this.$paymentForm = $(".payment-form", this.$el);
this.$submit.click(this.donate); this.$submit.click(this.donate);
......
...@@ -1188,14 +1188,14 @@ ...@@ -1188,14 +1188,14 @@
} }
.amount { .amount {
padding: $baseline ($baseline/2); height: 40px;
width: 80px; width: 80px;
vertical-align: middle; vertical-align: middle;
text-align: left; text-align: left;
border: 2px; border: 2px solid $white;
&.validation-error { &.validation-error {
border: 2px solid $pink; border: 2px solid $error-color;
} }
} }
......
...@@ -4,4 +4,4 @@ ...@@ -4,4 +4,4 @@
<input class="amount" type="text" name="amount" value="25" /> <input class="amount" type="text" name="amount" value="25" />
<button class="btn action-primary action-donate" type="submit" name="Donate"><%- gettext('Donate') %></button> <button class="btn action-primary action-donate" type="submit" name="Donate"><%- gettext('Donate') %></button>
</form> </form>
<form class="payment-form"></form> <form class="payment-form"></form>
\ No newline at end of file
...@@ -16,11 +16,11 @@ ...@@ -16,11 +16,11 @@
</div> </div>
</div> </div>
% if course_msg["allow_donation"]: % if course_msg["allow_donation"]:
<div class="nav-actions donate-actions"> <div class="nav-actions donate-actions">
<h3 class="sr">${_('Donation Actions')}</h3> <h3 class="sr">${_('Donation Actions')}</h3>
<div class="donate-container" data-course="${ course_msg['course_id'] }"></div> <div class="donate-container" data-course="${ course_msg['course_id'] }"></div>
</div> </div>
% endif % endif
</div> </div>
</div> </div>
% endfor % endfor
\ No newline at end of file
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