new_contents: import unittest
  import transaction
  import testing.postgresql
  import webtest
  import urllib
  from pyramid.paster import get_app
  from sqlalchemy import create_engine
  
  from .models import (
      DBSession,
      Base
  )
  
  from . import test_data
  
  class TestBugs(unittest.TestCase):
      '''Tests for issues.
  
      https://github.com/colinhiggs/pyramid-jsonapi/issues
      '''
  
      @classmethod
      def setUpClass(cls):
          '''Create a test DB and import data.'''
          # Create a new database somewhere in /tmp
          cls.postgresql = testing.postgresql.Postgresql(port=7654)
          cls.engine = create_engine(cls.postgresql.url())
          DBSession.configure(bind=cls.engine)
  
          cls.app = get_app('testing.ini')
          cls.test_app = webtest.TestApp(cls.app)
  
      @classmethod
      def tearDownClass(cls):
          '''Throw away test DB.'''
          DBSession.close()
          cls.postgresql.stop()
  
      def setUp(self):
          Base.metadata.create_all(self.engine)
          # Add some basic test data.
          test_data.add_to_db()
          transaction.begin()
  
      def tearDown(self):
          transaction.abort()
          Base.metadata.drop_all(self.engine)
  
subject: add test suite for issues and bugs