def delete(request, collection_id=None): """Deletes a collection.""" services.delete_collection(collection_id) response = redirect('collectionIndex') response['Location'] += '?instructor=edit' log.info('Collection %(c)s deleted.' % {'c': str(collection_id)}, extra={'user': request.user}) analytics.track(actor=request.user, verb=analytics.VERBS.deleted, object=analytics.OBJECTS.collection, context={"collection_id": collection_id}) return response
def delete(request, collection_id=None): """Deletes a collection.""" services.delete_collection(collection_id) response = redirect('collectionIndex') response['Location'] += '?instructor=edit' log.info('Collection %(c)s deleted.' %{'c': str(collection_id)}, extra={'user': request.user}) analytics.track( actor=request.user, verb=analytics.VERBS.deleted, object=analytics.OBJECTS.collection, context={"collection_id": collection_id} ) return response
def test_deleteCollection(self): collection = self.make_collection() self.assertEqual(services.delete_collection(collection.id), True)