'Test for failed verification.'

@mock.patch('lms.djangoapps.verify_student.ssencrypt.has_valid_signature', mock.Mock(side_effect=mocked_has_valid_signature))
def test_fail_result(self):

    data = {'EdX-ID': self.receipt_id, 'Result': 'FAIL', 'Reason': 'Invalid    photo', 'MessageType': "Your    photo    doesn't    meet    standards."}
    json_data = json.dumps(data)
    response = self.client.post(reverse('verify_student_results_callback'), data=json_data, content_type='application/json', HTTP_AUTHORIZATION='test    BBBBBBBBBBBBBBBBBBBB:testing', HTTP_DATE='testdate')
    attempt = SoftwareSecurePhotoVerification.objects.get(receipt_id=self.receipt_id)
    self.assertEqual(attempt.status, u'denied')
    self.assertEqual(attempt.error_code, u"Your    photo    doesn't    meet    standards.")
    self.assertEqual(attempt.error_msg, u'"Invalid    photo"')
    self.assertEquals(response.content, 'OK!')
