Commit eb914a00 by Nimisha Asthagiri

Merge pull request #11564 from edx/release

Release Feb 17, 2016
parents 80c68e42 71b30809
docs.edx.org
This is the Github-hosted branch of edx-platform that is behind
http://docs.edx.org
This source diff could not be displayed because it is too large. You can view the blob instead.
/* Space out content a bit */
body {
padding-top: 20px;
padding-bottom: 20px;
}
/* Everything but the jumbotron gets side spacing for mobile first views */
.header,
.marketing,
.footer {
padding-left: 15px;
padding-right: 15px;
}
/* Custom page header */
.header {
border-bottom: 1px solid #e5e5e5;
}
/* Make the masthead heading the same height as the navigation */
.header h3 {
margin-top: 0;
margin-bottom: 0;
line-height: 40px;
padding-bottom: 19px;
}
/* Custom page footer */
.footer {
padding-top: 19px;
color: #777;
border-top: 1px solid #e5e5e5;
}
/* Customize container */
@media (min-width: 768px) {
.container {
max-width: 730px;
}
}
.container-narrow > hr {
margin: 30px 0;
}
/* Main marketing message and sign up button */
.jumbotron {
text-align: center;
border-bottom: 1px solid #e5e5e5;
}
.jumbotron .btn {
font-size: 21px;
padding: 14px 24px;
}
/* Supporting marketing content */
.marketing {
margin: 40px 0;
}
.marketing p + h4 {
margin-top: 28px;
}
/* Responsive: Portrait tablets and up */
@media screen and (min-width: 768px) {
/* Remove the padding we set earlier */
.header,
.marketing,
.footer {
padding-left: 0;
padding-right: 0;
}
/* Space out the masthead */
.header {
margin-bottom: 30px;
}
/* Remove the bottom border on the jumbotron for visual effect */
.jumbotron {
border-bottom: 0;
}
}
/* ==========================================================================
Author's custom styles
========================================================================== */
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title>edX | docs</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/jumbotron-narrow.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="jumbotron">
<h1>edX | docs</h1>
<p class="lead">
Documentation for the open source edX platform<br />
Designed for Developers and Course Authors
</p>
</div>
<div class="row marketing">
<div class="col-lg-12">
<h4>How we build docs</h4>
<p>
Our documentation is built with <a href="http://sphinx-doc.org/">Sphinx</a>
and hosted on <a href="https://readthedocs.org/">ReadTheDocs</a>. We chose these tools
because of their open source nature and dedication to the Python community.
If you can write in <a href="http://docutils.sourceforge.net/rst.html">reStructuredText</a>
format (it's like Markdown), we would love contributions to our documentation.
</p>
<p>
To get started, choose your documentation path.
</p>
<p align="center">
<a class="btn btn-lg btn-info" href="http://edx.readthedocs.org/projects/devdata/en/latest/">I'm a Developer or a Researcher</a>
<a class="btn btn-lg btn-info" href="http://edx.readthedocs.org/projects/ca/en/latest/">I'm an Author</a>
</p>
</div>
<div class="footer">
<p>&copy; 2013 <a href="http://www.edx.org">edX</a>. All rights reserved.</p>
</div>
</div> <!-- /container -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
</body>
</html>
......@@ -674,7 +674,7 @@ class TestPayAndVerifyView(UrlResetMixin, ModuleStoreTestCase, XssTestMixin):
@ddt.data("verify_student_start_flow", "verify_student_begin_flow")
def test_verification_deadline(self, payment_flow):
deadline = datetime(2999, 1, 2, tzinfo=pytz.UTC)
deadline = datetime.now(tz=pytz.UTC) + timedelta(days=360)
course = self._create_course("verified")
# Set a deadline on the course mode AND on the verification deadline model.
......@@ -687,10 +687,10 @@ class TestPayAndVerifyView(UrlResetMixin, ModuleStoreTestCase, XssTestMixin):
# Expect that the expiration date is set
response = self._get_page(payment_flow, course.id)
data = self._get_page_data(response)
self.assertEqual(data['verification_deadline'], "Jan 02, 2999 at 00:00 UTC")
self.assertEqual(data['verification_deadline'], deadline.strftime("%b %d, %Y at %H:%M UTC"))
def test_course_mode_expired(self):
deadline = datetime(1999, 1, 2, tzinfo=pytz.UTC)
deadline = datetime.now(tz=pytz.UTC) + timedelta(days=-360)
course = self._create_course("verified")
# Set the upgrade deadline (course mode expiration) and verification deadline
......@@ -705,22 +705,32 @@ class TestPayAndVerifyView(UrlResetMixin, ModuleStoreTestCase, XssTestMixin):
# to the student that the deadline has passed
response = self._get_page("verify_student_verify_now", course.id)
self.assertContains(response, "verification deadline")
self.assertContains(response, "Jan 02, 1999 at 00:00 UTC")
self.assertContains(response, deadline.strftime("%b %d, %Y at %H:%M UTC"))
@ddt.data(datetime(2999, 1, 2, tzinfo=pytz.UTC), None)
@ddt.data(datetime.now(tz=pytz.UTC) + timedelta(days=360), None)
def test_course_mode_expired_verification_deadline_in_future(self, verification_deadline):
course = self._create_course("verified")
"""Verify that student can not upgrade in expired course mode."""
course_modes = ("verified", "credit")
course = self._create_course(*course_modes)
# Set the upgrade deadline in the past, but the verification
# Set the upgrade deadline of verified mode in the past, but the verification
# deadline in the future.
self._set_deadlines(
course.id,
upgrade_deadline=datetime(1999, 1, 2, tzinfo=pytz.UTC),
upgrade_deadline=datetime.now(tz=pytz.UTC) + timedelta(days=-360),
verification_deadline=verification_deadline,
)
# Set the upgrade deadline for credit mode in future.
self._set_deadlines(
course.id,
upgrade_deadline=datetime.now(tz=pytz.UTC) + timedelta(days=360),
verification_deadline=verification_deadline,
mode_slug="credit"
)
# Try to pay or upgrade.
# We should get an error message since the deadline has passed.
# We should get an error message since the deadline has passed and did not allow
# directly sale of credit mode.
for page_name in ["verify_student_start_flow",
"verify_student_begin_flow",
"verify_student_upgrade_and_verify"]:
......@@ -738,9 +748,13 @@ class TestPayAndVerifyView(UrlResetMixin, ModuleStoreTestCase, XssTestMixin):
data = self._get_page_data(response)
self.assertEqual(data['message_key'], PayAndVerifyView.VERIFY_NOW_MSG)
# Check that the mode selected is expired verified mode not the credit mode
# because the direct enrollment to the credit mode is not allowed.
self.assertEqual(data['course_mode_slug'], "verified")
# Check that the verification deadline (rather than the upgrade deadline) is displayed
if verification_deadline is not None:
self.assertEqual(data["verification_deadline"], "Jan 02, 2999 at 00:00 UTC")
self.assertEqual(data["verification_deadline"], verification_deadline.strftime("%b %d, %Y at %H:%M UTC"))
else:
self.assertEqual(data["verification_deadline"], "")
......@@ -753,10 +767,12 @@ class TestPayAndVerifyView(UrlResetMixin, ModuleStoreTestCase, XssTestMixin):
# since it's a bad user experience
# to purchase a verified track and then not be able to verify,
# but if it happens we need to handle it gracefully.
upgrade_deadline_in_future = datetime.now(tz=pytz.UTC) + timedelta(days=360)
verification_deadline_in_past = datetime.now(tz=pytz.UTC) + timedelta(days=-360)
self._set_deadlines(
course.id,
upgrade_deadline=datetime(2999, 1, 2, tzinfo=pytz.UTC),
verification_deadline=datetime(1999, 1, 2, tzinfo=pytz.UTC),
upgrade_deadline=upgrade_deadline_in_future,
verification_deadline=verification_deadline_in_past,
)
# Enroll as verified (simulate purchasing the verified enrollment)
......@@ -767,7 +783,7 @@ class TestPayAndVerifyView(UrlResetMixin, ModuleStoreTestCase, XssTestMixin):
# message when we go to verify.
response = self._get_page("verify_student_verify_now", course.id)
self.assertContains(response, "verification deadline")
self.assertContains(response, "Jan 02, 1999 at 00:00 UTC")
self.assertContains(response, verification_deadline_in_past.strftime("%b %d, %Y at %H:%M UTC"))
@mock.patch.dict(settings.FEATURES, {'EMBARGO': True})
@ddt.data("verify_student_start_flow", "verify_student_begin_flow")
......@@ -841,7 +857,7 @@ class TestPayAndVerifyView(UrlResetMixin, ModuleStoreTestCase, XssTestMixin):
attempt.created_at = datetime.now(pytz.UTC) - timedelta(days=(days_good_for + 1))
attempt.save()
def _set_deadlines(self, course_key, upgrade_deadline=None, verification_deadline=None):
def _set_deadlines(self, course_key, upgrade_deadline=None, verification_deadline=None, mode_slug="verified"):
"""
Set the upgrade and verification deadlines.
......@@ -858,7 +874,7 @@ class TestPayAndVerifyView(UrlResetMixin, ModuleStoreTestCase, XssTestMixin):
"""
# Set the course mode expiration (same as the "upgrade" deadline)
mode = CourseMode.objects.get(course_id=course_key, mode_slug="verified")
mode = CourseMode.objects.get(course_id=course_key, mode_slug=mode_slug)
mode.expiration_datetime = upgrade_deadline
mode.save()
......
......@@ -522,9 +522,9 @@ class PayAndVerifyView(View):
if mode.min_price > 0 and not CourseMode.is_credit_mode(mode):
return mode
# Otherwise, find the first expired mode
# Otherwise, find the first non credit expired paid mode
for mode in all_modes[course_key]:
if mode.min_price > 0:
if mode.min_price > 0 and not CourseMode.is_credit_mode(mode):
return mode
# Otherwise, return None and so the view knows to respond with a 404.
......
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