Source code for sqlobject.tests.test_class_hash

fromsqlobjectimport SQLObject, StringCol
fromsqlobject.tests.dbtestimport setupClass
########################################
# Test hashing a column instance
########################################
[docs] classClassHashTest(SQLObject): name = StringCol(length=50, alternateID=True, dbName='name_col')
[docs] deftest_class_hash(): setupClass(ClassHashTest) ClassHashTest(name='bob') b = ClassHashTest.byName('bob') hashed = hash(b) b.expire() b = ClassHashTest.byName('bob') assert hash(b) == hashed