Exemplo n.º 1
0
 def test_changeset_for_update(self):
     article = self.Article(name=u'Some article')
     self.session.add(article)
     self.session.commit()
     article.tags
     article.name = u'Updated article'
     assert changeset(article) == {
         'name': [u'Updated article', u'Some article']
     }
 def changeset(model_object):
     from sqlalchemy_continuum import changeset
     return changeset(model_object)
 def changeset(model_object):
     from sqlalchemy_continuum import changeset
     return changeset(model_object)
Exemplo n.º 4
0
 def changeset(self):
     """
     Return SQLAlchemy-Continuum changeset for object.
     """
     return changeset(self)
Exemplo n.º 5
0
 def test_changeset_for_deletion(self):
     article = self.Article(name=u'Some article')
     self.session.add(article)
     self.session.commit()
     self.session.delete(article)
     assert changeset(article) == {'name': [None, u'Some article']}
Exemplo n.º 6
0
 def test_changeset_for_new_value(self):
     article = self.Article(name=u'Some article')
     assert changeset(article) == {'name': [u'Some article', None]}