Exemple #1
0
    def test_copy(self):
        p = PropertyManager(db)
        pid = p.get_property_id("/type/object", "title", create=True)

        # copy should inherit the cache
        p2 = p.copy()
        assert p2.get_property_id("/type/object", "title") == pid

        # changes to the cache of the copy shouldn't affect the source.
        tx = db.transaction()
        p2.get_property_id("/type/object", "title2", create=True)
        tx.rollback()
        assert p.get_property_id("/type/object", "title2") is None
Exemple #2
0
 def test_copy(self):
     p = PropertyManager(db)
     pid = p.get_property_id("/type/object", "title", create=True)
     
     # copy should inherit the cache
     p2 = p.copy()
     assert p2.get_property_id("/type/object", "title") == pid
     
     # changes to the cache of the copy shouldn't effect the source.
     tx = db.transaction()
     p2.get_property_id("/type/object", "title2", create=True)
     tx.rollback()        
     assert p.get_property_id("/type/object", "title2") is None