old_contents: import py.test
  from sqlobject import *
  from sqlobject.tests.dbtest import *
  
  
  ########################################
  # BLOB columns
  ########################################
  
  
  class ImageData(SQLObject):
      image = BLOBCol(default='emptydata', length=65535)
  
  
  def test_BLOBCol():
      if not supports('blobData'):
          py.test.skip("blobData isn't supported")
      setupClass(ImageData)
      data = ''.join([chr(x) for x in range(256)])
  
      prof = ImageData()
      prof.image = data
      iid = prof.id
  
      ImageData._connection.cache.clear()
  
      prof2 = ImageData.get(iid)
      assert prof2.image == data
  
new_contents: import sys
  import py.test
  from sqlobject import *
  from sqlobject.tests.dbtest import *
  
  
  ########################################
  # BLOB columns
  ########################################
  
  
  class ImageData(SQLObject):
      image = BLOBCol(default=b'emptydata', length=65535)
  
  
  def test_BLOBCol():
      if not supports('blobData'):
          py.test.skip("blobData isn't supported")
      setupClass(ImageData)
      if sys.version_info[0] == 2:
          data = ''.join([chr(x) for x in range(256)])
      else:
          data = bytes(range(256))
  
      prof = ImageData()
      prof.image = data
      iid = prof.id
  
      ImageData._connection.cache.clear()
  
      prof2 = ImageData.get(iid)
      assert prof2.image == data
  
subject: Tweak test_blob to use bytes