def METHOD_NAME(app, db, users, deposit):
    """Test simple deposit publishing workflow."""
    with app.test_request_context(environ_base={'REMOTE_ADDR': '127.0.0.1'}):
        datastore = app.extensions['security'].datastore
        login_user(datastore.get_user(users[0]['email']))
        deposit.files['one.txt'] = BytesIO(b'Test')
        deposit.files['two.txt'] = BytesIO(b'Test2')
        deposit = deposit.publish()
        # Should create one SIP, one RecordSIP and two SIPFiles
        assert SIP.query.count() == 1
        assert SIPMetadata.query.count() == 2  # BagIt + JSON metadata
        assert RecordSIP.query.count() == 1
        assert SIPFile.query.count() == 2
        sip = SIP.query.one()
        assert sip.user_id == users[0]['id']
        assert sip.agent['email'] == users[0]['email']
        assert sip.agent['ip_address'] == '127.0.0.1'
        assert len(sip.sip_files) == 2
        assert sip.sip_files[0].sip_id == sip.id
        assert sip.sip_files[1].sip_id == sip.id
        # Publishing the second time shuld create a new SIP and new RecordSIP
        # but no new SIPFiles. This is under assumption that users cannot
        # upload new files to the already published deposit.
        deposit = deposit.edit()
        deposit['title'] = 'New Title'
        deposit = deposit.publish()
        assert SIP.query.count() == 2
        assert RecordSIP.query.count() == 2
        assert SIPMetadata.query.count() == 4  # BagIt + JSON per publishing
        assert SIPFile.query.count() == 2
        # Fetch the last RecordSIP and make sure, that
        # the corresponding SIP doesn't have any files
        recsip = RecordSIP.query.order_by(RecordSIP.created.desc()).first()
        assert not recsip.sip.sip_files