def test_view_index(self):
        "Create an index on a materialized view"
        if self.db.version < 90300:
            self.skipTest('Only available on PG 9.3')
        stmts = [CREATE_TABLE, CREATE_STMT]
        inmap = self.std_map()
        inmap['schema public'].update({'table t1': {
            'columns': [{'c1': {'type': 'integer'}}, {'c2': {'type': 'text'}},
                        {'c3': {'type': 'integer'}}]}})
        inmap['schema public'].update({'materialized view mv1': {
            'definition': VIEW_DEFN, 'indexes': {'idx1': {'keys': ['mc3']}}}})
        sql = self.to_sql(inmap, stmts)
        print(sql)
        assert sql == ["CREATE INDEX idx1 ON mv1 (mc3)"]
dataset/ETHPy150Open perseas/Pyrseas/tests/dbobject/test_matview.py/MatViewToSqlTestCase.test_view_index/original