Add a test for donations with a white-label course mode

This commit is contained in:
Will Daly
2014-10-26 15:58:26 -04:00
parent ff4a1755d0
commit 2c062ca08b

View File

@@ -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")