Пример #1
0
    def test_atomic_update_for_string_addition_when_initially_empth(self, db):
        wiki_page = WikiPage.create(title='foo')

        wiki_page = WikiPage.get_by_id(1)

        (WikiPage.update(markdown=WikiPage.markdown +
                         'spam').where(WikiPage.id == wiki_page.id).execute())

        wiki_page = WikiPage.get_by_id(wiki_page.id)
        assert wiki_page.markdown == 'spam'
Пример #2
0
    def test_atomic_update_for_string_addition(self, db):
        wiki_page = WikiPage.create(title='foo', markdown='bar')

        (WikiPage.update(markdown=WikiPage.markdown +
                         ' spam').where(WikiPage.id == wiki_page.id).execute())

        wiki_page = WikiPage.get_by_id(wiki_page.id)
        assert wiki_page.markdown == 'bar spam'