def test_hard_deletion_of_collections(self):
        self.save_new_default_collection(self.COLLECTION_ID, self.owner_id)
        # The collection shows up in queries.
        self.assertEqual(
            _count_at_least_editable_collection_summaries(self.owner_id), 1)

        collection_services.delete_collection(
            self.owner_id, self.COLLECTION_ID, force_deletion=True)
        with self.assertRaises(Exception):
            collection_services.get_collection_by_id(self.COLLECTION_ID)

        # The deleted collection does not show up in any queries.
        self.assertEqual(
            _count_at_least_editable_collection_summaries(self.owner_id), 0)

        # The collection model has been purged from the backend.
        self.assertNotIn(self.COLLECTION_ID, [
            collection.id
            for collection in collection_models.CollectionModel.get_all(
                include_deleted_entities=True)])
Test that hard deletion of collections works correctly.
dataset/ETHPy150Open oppia/oppia/core/domain/collection_services_test.py/CollectionCreateAndDeleteUnitTests.test_hard_deletion_of_collections