code: def test_rollback(self):
      # Test that rollback undoes changes
      curs = self.conn.cursor()
      curs.execute("INSERT INTO table2 VALUES (2, 1)")
      # Rollback takes us from BEGIN state to READY state
      self.assertEqual(self.conn.status, STATUS_BEGIN)
      self.conn.rollback()
      self.assertEqual(self.conn.status, STATUS_READY)
      curs.execute("SELECT id, table1_id FROM table2 WHERE id = 2")
      self.assertEqual(curs.fetchall(), [])
  
imports: import threading
  import unittest
  from .testutils import ConnectingTestCase, skip_before_postgres, slow
  from .testutils import skip_if_crdb
  import psycopg2
  from psycopg2.extensions import ISOLATION_LEVEL_SERIALIZABLE, STATUS_BEGIN, STATUS_READY
label_desc: Use image node_id 2 for calling the TransactionTests obj's underlying member method code with example usage: obj.test_rollback() without return types