@@ -0,0 +1,1250 @@
+# -*- coding: utf-8 -*-%0Afrom aiohttp.test_utils import make_mocked_request%0Afrom plone.server.browser import View%0Afrom plone.server.transactions import RequestAwareDB%0Afrom plone.server.transactions import RequestAwareTransactionManager%0Afrom plone.server.transactions import TransactionProxy%0Aimport pytest%0Aimport ZODB.DemoStorage%0A%0A%0A@pytest.yield_fixture(scope='module')%0Adef conn():%0A    storage = ZODB.DemoStorage.DemoStorage()%0A    ZODB.DB(storage).close()  # init storage with root%0A    db = RequestAwareDB(storage)%0A    tm = RequestAwareTransactionManager()%0A    yield db.open(transaction_manager=tm)%0A%0A%0A@pytest.yield_fixture(scope='module')%0Adef view(conn):%0A    request = make_mocked_request('POST', '/')%0A    yield View(conn.root(), request)%0A%0A%0Adef test_transaction_proxy(view):%0A    tm = view.context._p_jar.transaction_manager%0A%0A    request1 = view.request%0A    t1 = tm.begin(request1)%0A    assert hasattr(request1, '_txn')%0A    assert hasattr(request1, '_txn_time')%0A%0A    request2 = TransactionProxy(view.request)%0A    t2 = tm.begin(request2)%0A    assert hasattr(request2, '_txn')%0A    assert hasattr(request2, '_txn_time')%0A%0A    assert t1 is not t2%0A    assert t1 is request1._txn%0A    assert t2 is request2._txn%0A    assert request1._txn_time %3C request2._txn_time%0A

Add tests for transaction proxy