'Verifies option to overwrite connection schema'

def test_overwrite_schema(self):

    import airflow.operators.postgres_operator
    sql = 'SELECT    1;'
    t = operators.postgres_operator.PostgresOperator(task_id='postgres_operator_test_schema_overwrite', sql=sql, dag=self.dag, autocommit=True, database='foobar')
    from psycopg2._psycopg import OperationalError
    try:
        t.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE, ignore_ti_state=True)
    except OperationalError as e:
        assert ('database    "foobar"    does    not    exist' in str(e))
