'Test that the orphan handler deletes the orphans'

@ddt.data((ModuleStoreEnum.Type.split, 9, 5), (ModuleStoreEnum.Type.mongo, 34, 12))
@ddt.unpack
def test_delete_orphans(self, default_store, max_mongo_calls, min_mongo_calls):

    course = self.create_course_with_orphans(default_store)
    orphan_url = reverse_course_url('orphan_handler', course.id)
    with check_mongo_calls_range(max_mongo_calls, min_mongo_calls):
        self.client.delete(orphan_url)
    orphans = json.loads(self.client.get(orphan_url, HTTP_ACCEPT='application/json').content)
    self.assertEqual(len(orphans), 0, 'Orphans    not    deleted    {}'.format(orphans))
    self.assertTrue(self.store.has_item(course.id.make_usage_key('html', 'multi_parent_html')))
