def test_entrance_exam_xblock_response(self):
     """
     Tests entrance exam xblock has `entrance_exam_passed` key in json response.
     """
     request_factory = RequestFactoryNoCsrf()
     data = {
         'input_{}_2_1'.format(unicode(self.problem_1.location.html_id())):
         'choice_2'
     }
     request = request_factory.post('problem_check', data=data)
     request.user = self.user
     response = handle_xblock_callback(
         request,
         unicode(self.course.id),
         unicode(self.problem_1.location),
         'xmodule_handler',
         'problem_check',
     )
     self.assertEqual(response.status_code, 200)
     self.assertIn('entrance_exam_passed', response.content)
 def test_entrance_exam_xblock_response(self):
     """
     Tests entrance exam xblock has `entrance_exam_passed` key in json response.
     """
     request_factory = RequestFactoryNoCsrf()
     data = {'input_{}_2_1'.format(unicode(self.problem_1.location.html_id())): 'choice_2'}
     request = request_factory.post(
         'problem_check',
         data=data
     )
     request.user = self.user
     response = handle_xblock_callback(
         request,
         unicode(self.course.id),
         unicode(self.problem_1.location),
         'xmodule_handler',
         'problem_check',
     )
     self.assertEqual(response.status_code, 200)
     self.assertIn('entrance_exam_passed', response.content)