def test_verb_put_existing(self):
        apimgr = self.create_mgr()
        apimgr.add(SqlAlchemyEndpoint(self.db, self.Book, ['title']))

        book = self.Book()
        book.title = 'title'
        self.db.session.add(book)
        self.db.session.flush()
        book_id = book.id

        new_title = 'new title'
        data_in = json.dumps(dict(title=new_title))
        response = self.client.put('/book/%s' % book.id, data=data_in)
        self.assert_200(response)
        # TODO: would be nice to just self.db.session.refresh(book) -- why doesn't this work?
        book = self.Book.query.filter_by(id=book_id).first()
        self.assertEqual(book.title, new_title)
dataset/ETHPy150Open ahri/flask-snooze/tests/test_snooze_sqlalchemyendpoint.py/TestSnoozeHttp.test_verb_put_existing/original