Exemplo n.º 1
0
def test_delete_does_not_crash_if_annotation_has_no_group():
    annotation = mock.MagicMock()
    annotation_data = {}  # No 'group' key.
    annotation.get.side_effect = annotation_data.get
    annotation.__getitem__.side_effect = annotation_data.__getitem__

    logic.delete_annotation(annotation)
Exemplo n.º 2
0
def test_delete_does_not_crash_if_annotation_has_no_group():
    annotation = mock.MagicMock()
    annotation_data = {}  # No 'group' key.
    annotation.get.side_effect = annotation_data.get
    annotation.__getitem__.side_effect = annotation_data.__getitem__

    logic.delete_annotation(annotation)
Exemplo n.º 3
0
Arquivo: views.py Projeto: chrber/h
def delete(context, request):
    """Delete the annotation permanently."""
    annotation = context.model

    logic.delete_annotation(annotation)

    # Notify any subscribers
    _publish_annotation_event(request, annotation, "delete")

    # Return a confirmation
    return {"id": annotation["id"], "deleted": True}
Exemplo n.º 4
0
def delete(context, request):
    """Delete the annotation permanently."""
    annotation = context.model

    logic.delete_annotation(annotation)

    # Notify any subscribers
    _publish_annotation_event(request, annotation, 'delete')

    # Return a confirmation
    return {
        'id': annotation['id'],
        'deleted': True,
    }
Exemplo n.º 5
0
Arquivo: views.py Projeto: linhua55/h
def delete(context, request):
    """Delete the annotation permanently."""
    annotation = context.model

    logic.delete_annotation(annotation)

    # Notify any subscribers
    _publish_annotation_event(request, annotation, 'delete')

    # Return a confirmation
    return {
        'id': annotation['id'],
        'deleted': True,
    }
Exemplo n.º 6
0
def test_delete_annotation_calls_delete():
    annotation = mock.MagicMock()

    logic.delete_annotation(annotation)

    annotation.delete.assert_called_once_with()
Exemplo n.º 7
0
def test_delete_annotation_calls_delete():
    annotation = mock.MagicMock()

    logic.delete_annotation(annotation)

    annotation.delete.assert_called_once_with()