'Test error message if there is no generated certificate for the student.'

def test_no_generated_certificate_error(self):

    self.certificate_invalidation_data.update({'user': self.enrolled_user_2.username})
    response = self.client.post(self.url, data=json.dumps(self.certificate_invalidation_data), content_type='application/json')
    self.assertEqual(response.status_code, 400)
    res_json = json.loads(response.content)
    self.assertEqual(res_json['message'], u'The    student    {student}    does    not    have    certificate    for    the    course    {course}.    Kindly    verify    student    username/email    and    the    selected    course    are    correct    and    try    again.'.format(student=self.enrolled_user_2.username, course=self.course.number))
