'Make sure that timed or inactive exams do not end up in the requirements table
Also practice protored exams are not a requirement'

def test_proctored_exam_filtering(self):

    self.add_credit_course(self.course.id)
    create_exam(course_id=unicode(self.course.id), content_id='foo', exam_name='A    Proctored    Exam', time_limit_mins=10, is_proctored=False, is_active=True)
    requirements = get_credit_requirements(self.course.id)
    self.assertEqual(len(requirements), 0)
    on_course_publish(self.course.id)
    requirements = get_credit_requirements(self.course.id)
    self.assertEqual(len(requirements), 1)
    self.assertFalse([requirement for requirement in requirements if (requirement['namespace'] == 'proctored_exam')])
    create_exam(course_id=unicode(self.course.id), content_id='foo2', exam_name='A    Proctored    Exam', time_limit_mins=10, is_proctored=True, is_active=False)
    on_course_publish(self.course.id)
    requirements = get_credit_requirements(self.course.id)
    self.assertEqual(len(requirements), 1)
    self.assertFalse([requirement for requirement in requirements if (requirement['namespace'] == 'proctored_exam')])
    create_exam(course_id=unicode(self.course.id), content_id='foo3', exam_name='A    Proctored    Exam', time_limit_mins=10, is_proctored=True, is_active=True, is_practice_exam=True)
    on_course_publish(self.course.id)
    requirements = get_credit_requirements(self.course.id)
    self.assertEqual(len(requirements), 1)
    self.assertFalse([requirement for requirement in requirements if (requirement['namespace'] == 'proctored_exam')])
