diff --git a/cms/envs/bok_choy.auth.json b/cms/envs/bok_choy.auth.json index 17b46a9b6c..e0b60afbd3 100644 --- a/cms/envs/bok_choy.auth.json +++ b/cms/envs/bok_choy.auth.json @@ -26,7 +26,7 @@ "default": { "ENGINE": "django.db.backends.mysql", "HOST": "localhost", - "NAME": "test", + "NAME": "edxtest", "PASSWORD": "", "PORT": "3306", "USER": "root" diff --git a/lms/djangoapps/verify_student/tests/test_views.py b/lms/djangoapps/verify_student/tests/test_views.py index 24180fc710..20933bd689 100644 --- a/lms/djangoapps/verify_student/tests/test_views.py +++ b/lms/djangoapps/verify_student/tests/test_views.py @@ -140,6 +140,20 @@ class TestCreateOrderView(ModuleStoreTestCase): self.assertEquals(response.status_code, 400) self.assertIn('This course doesn\'t support verified certificates', response.content) + @patch.dict(settings.FEATURES, {'AUTOMATIC_VERIFY_STUDENT_IDENTITY_FOR_TESTING': True}) + def test_create_order_fail_with_get(self): + """ + Test that create_order will not work if wrong http method used + """ + create_order_post_data = { + 'contribution': 50, + 'course_id': self.course_id, + 'face_image': ',', + 'photo_id_image': ',' + } + response = self.client.get(reverse('verify_student_create_order'), create_order_post_data) + self.assertEqual(response.status_code, 405) + @patch.dict(settings.FEATURES, {'AUTOMATIC_VERIFY_STUDENT_IDENTITY_FOR_TESTING': True}) def test_create_order_success(self): """ diff --git a/lms/djangoapps/verify_student/views.py b/lms/djangoapps/verify_student/views.py index 51969c5d7e..c5bbda25cc 100644 --- a/lms/djangoapps/verify_student/views.py +++ b/lms/djangoapps/verify_student/views.py @@ -167,6 +167,7 @@ class VerifiedView(View): return render_to_response('verify_student/verified.html', context) +@require_POST @login_required def create_order(request): """ diff --git a/lms/envs/bok_choy.auth.json b/lms/envs/bok_choy.auth.json index 1d244c93e8..8504e8c276 100644 --- a/lms/envs/bok_choy.auth.json +++ b/lms/envs/bok_choy.auth.json @@ -26,7 +26,7 @@ "default": { "ENGINE": "django.db.backends.mysql", "HOST": "localhost", - "NAME": "test", + "NAME": "edxtest", "PASSWORD": "", "PORT": "3306", "USER": "root" diff --git a/lms/static/js/spec/photocapture_spec.js b/lms/static/js/spec/photocapture_spec.js index bcac881188..14a76bade9 100644 --- a/lms/static/js/spec/photocapture_spec.js +++ b/lms/static/js/spec/photocapture_spec.js @@ -4,7 +4,7 @@ define(['backbone', 'jquery', 'js/verify_student/photocapture'], describe("Photo Verification", function () { beforeEach(function () { - setFixtures('