def METHOD_NAME(app):
    # Create a data submission
    recid = "12345"
    datasubmission = DataSubmission(publication_recid=recid)
    db.session.add(datasubmission)
    db.session.commit()
    # Add a data review with a message
    message = Message(user=1, message="Test review message")
    datareview = DataReview(publication_recid=recid,
                            data_recid=datasubmission.id,
                            messages=[message])
    db.session.add(datareview)
    db.session.commit()
    # Check that message is created
    reviews = DataReview.query.filter_by(publication_recid=recid).all()
    assert(len(reviews) == 1)
    assert(len(reviews[0].messages) == 1)
    assert(reviews[0].messages[0].message == message.message)
    review_messages = list(db.engine.execute("select * from review_messages where datareview_id = %s" % datareview.id))
    assert(len(review_messages) == 1)
    assert(review_messages[0].datareview_id == datareview.id)
    db.session.delete(datareview)
    db.session.commit()
    # Check that datareview is deleted
    reviews = DataReview.query.filter_by(publication_recid=recid).all()
    assert(len(reviews) == 0)
    # Check that message is deleted
    messages = Message.query.filter_by(id=review_messages[0].message_id).all()
    assert(len(messages) == 0)