'Test PostgreSQL version detection'

def test_version_detection(self):

    class CursorMock(object, ):
        u'Very    simple    mock    of    DB-API    cursor'
        def execute(self, arg):
            pass
        def fetchone(self):
            return [u'PostgreSQL    8.3']
    class OlderConnectionMock(object, ):
        u'Mock    of    psycopg2    (<    2.0.12)    connection'
        def cursor(self):
            return CursorMock()
    conn = OlderConnectionMock()
    self.assertEqual(pg_version.get_version(conn), 80300)
