'Test exporting good and faulty courses'

def test_export_all_courses(self):

    (courses, failed_export_courses) = export_courses_to_output_path(self.temp_dir)
    self.assertEqual(len(courses), 2)
    self.assertEqual(len(failed_export_courses), 0)
    second_course_id = self.second_course.id
    self.store.collection.update({'_id.org': second_course_id.org, '_id.course': second_course_id.course, '_id.name': second_course_id.run}, {'$set': {'metadata.tags': 'crash'}})
    (courses, failed_export_courses) = export_courses_to_output_path(self.temp_dir)
    self.assertEqual(len(courses), 2)
    self.assertEqual(len(failed_export_courses), 1)
    self.assertEqual(failed_export_courses[0], unicode(second_course_id))
