def test_updates_changed_data(self, session, user, connection):
     remove_column(connection, 'user', 'name')
     activity = last_activity(connection)
     assert activity['old_data'] is None
     assert activity['changed_data'] == {
         'id': user.id,
         'age': 15
     }
 def test_updates_changed_data(self, session, user, connection):
     remove_column(connection, 'user', 'name')
     activity = last_activity(connection)
     assert activity['old_data'] == {}
     assert activity['changed_data'] == {
         'id': user.id,
         'age': 15
     }
 def test_updates_old_data(self, session, user, connection):
     user.name = 'Luke'
     session.commit()
     remove_column(connection, 'user', 'name')
     activity = last_activity(connection)
     assert activity['old_data'] == {
         'id': user.id,
         'age': 15
     }
 def test_updates_old_data(self, session, user, connection):
     user.name = 'Luke'
     session.commit()
     remove_column(connection, 'user', 'name')
     activity = last_activity(connection)
     assert activity['old_data'] == {
         'id': user.id,
         'age': 15
     }
 def test_only_updates_given_table(
     self,
     session,
     article,
     user,
     connection
 ):
     remove_column(connection, 'user', 'name')
     activity = session.query(versioning_manager.activity_cls).filter_by(
         table_name='article'
     ).one()
     assert 'name' in activity.changed_data
 def test_only_updates_given_table(
     self,
     session,
     article,
     user,
     connection,
     versioning_manager
 ):
     remove_column(connection, 'user', 'name')
     activity = session.query(versioning_manager.activity_cls).filter_by(
         table_name='article'
     ).one()
     assert 'name' in activity.changed_data
예제 #7
0
def remove_column_from_activity(operations, operation):
    conn = operations.connection
    remove_column(conn, operation.table_name, operation.column_name, operation.schema)