Show
Ignore:
Timestamp:
03/24/08 21:10:57 (4 years ago)
Author:
cleverdevil
Message:

Two changes to the versioning extension:

  • Applied a patch resolving ticket 35, so that the extension respects the current transaction.
  • Added an optional check_concurrency keyword argument to the extension, supporting the usage of SQLAlchemy's built-in optimistic concurrency check.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • elixir/trunk/tests/test_versioning.py

    r286 r312  
    145145        assert movie.version == 4 
    146146        assert movie.versions[-2].description == "description 3" 
     147 
     148        # Updates to the history table must be inside the transaction 
     149        session.begin() 
     150        movie = Movie(id=3, title='Foo', description='1') 
     151        session.commit(); 
     152         
     153        session.begin() 
     154        movie.description = '2' 
     155        session.flush() 
     156        session.rollback() 
     157        session.clear() 
     158         
     159        session.begin() 
     160        movie = Movie.get_by(title='Foo') 
     161        movie.description = '3' 
     162        session.commit() 
     163