Commit 1d64b50d by Julia Hansbrough

Merge pull request #4743 from edx/flowerhack/fix-upgrade-message

Basic fix for upgrade text bug
parents 5bf38806 3de1ab83
...@@ -68,7 +68,8 @@ class TestVerifyView(TestCase): ...@@ -68,7 +68,8 @@ class TestVerifyView(TestCase):
verified_mode = CourseMode(course_id=self.course_key, verified_mode = CourseMode(course_id=self.course_key,
mode_slug="verified", mode_slug="verified",
mode_display_name="Verified Certificate", mode_display_name="Verified Certificate",
min_price=50) min_price=50,
suggested_prices="50.0,100.0")
verified_mode.save() verified_mode.save()
def test_invalid_course(self): def test_invalid_course(self):
...@@ -76,9 +77,21 @@ class TestVerifyView(TestCase): ...@@ -76,9 +77,21 @@ class TestVerifyView(TestCase):
url = reverse('verify_student_verify', url = reverse('verify_student_verify',
kwargs={"course_id": fake_course_id}) kwargs={"course_id": fake_course_id})
response = self.client.get(url) response = self.client.get(url)
self.assertEquals(response.status_code, 302) self.assertEquals(response.status_code, 302)
def test_valid_course_registration_text(self):
url = reverse('verify_student_verify',
kwargs={"course_id": unicode(self.course_key)})
response = self.client.get(url)
self.assertIn("You are registering for", response.content)
def test_valid_course_upgrade_text(self):
url = reverse('verify_student_verify',
kwargs={"course_id": unicode(self.course_key)})
response = self.client.get(url, {'upgrade': "True"})
self.assertIn("You are upgrading your registration for", response.content)
@override_settings(MODULESTORE=TEST_DATA_MONGO_MODULESTORE) @override_settings(MODULESTORE=TEST_DATA_MONGO_MODULESTORE)
class TestVerifiedView(TestCase): class TestVerifiedView(TestCase):
......
...@@ -102,7 +102,7 @@ class VerifyView(View): ...@@ -102,7 +102,7 @@ class VerifyView(View):
"currency": verify_mode.currency.upper(), "currency": verify_mode.currency.upper(),
"chosen_price": chosen_price, "chosen_price": chosen_price,
"min_price": verify_mode.min_price, "min_price": verify_mode.min_price,
"upgrade": upgrade, "upgrade": upgrade == u'True',
"can_audit": "audit" in modes_dict, "can_audit": "audit" in modes_dict,
} }
...@@ -149,7 +149,7 @@ class VerifiedView(View): ...@@ -149,7 +149,7 @@ class VerifiedView(View):
"currency": verify_mode.currency.upper(), "currency": verify_mode.currency.upper(),
"chosen_price": chosen_price, "chosen_price": chosen_price,
"create_order_url": reverse("verify_student_create_order"), "create_order_url": reverse("verify_student_create_order"),
"upgrade": upgrade, "upgrade": upgrade == u'True',
"can_audit": "audit" in modes_dict, "can_audit": "audit" in modes_dict,
} }
return render_to_response('verify_student/verified.html', context) return render_to_response('verify_student/verified.html', context)
...@@ -302,7 +302,7 @@ def show_requirements(request, course_id): ...@@ -302,7 +302,7 @@ def show_requirements(request, course_id):
"course_org": course.display_org_with_default, "course_org": course.display_org_with_default,
"course_num": course.display_number_with_default, "course_num": course.display_number_with_default,
"is_not_active": not request.user.is_active, "is_not_active": not request.user.is_active,
"upgrade": upgrade, "upgrade": upgrade == u'True',
} }
return render_to_response("verify_student/show_requirements.html", context) return render_to_response("verify_student/show_requirements.html", context)
......
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