From 2c062ca08b4e418aca8a5a1bf283963aa4741eec Mon Sep 17 00:00:00 2001 From: Will Daly Date: Sun, 26 Oct 2014 15:58:26 -0400 Subject: [PATCH] Add a test for donations with a white-label course mode --- .../student/tests/test_recent_enrollments.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/common/djangoapps/student/tests/test_recent_enrollments.py b/common/djangoapps/student/tests/test_recent_enrollments.py index 34ec6e38b9..ccba26e903 100644 --- a/common/djangoapps/student/tests/test_recent_enrollments.py +++ b/common/djangoapps/student/tests/test_recent_enrollments.py @@ -154,3 +154,17 @@ class TestRecentEnrollments(ModuleStoreTestCase): self.assertContains(response, "donate-container") else: self.assertNotContains(response, "donate-container") + + def test_donate_button_honor_with_price(self): + # Enable the enrollment success message and donations + self._configure_message_timeout(10000) + DonationConfiguration(enabled=True).save() + + # Create a white-label course mode + # (honor mode with a price set) + CourseModeFactory(mode_slug="honor", course_id=self.course.id, min_price=100) + + # Check that the donate button is NOT displayed + self.client.login(username=self.student.username, password=self.PASSWORD) + response = self.client.get(reverse("dashboard")) + self.assertNotContains(response, "donate-container")