def test_create_view(self):
        "Create a materialized view"
        if self.db.version < 90300:
            self.skipTest('Only available on PG 9.3')
        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': "SELECT c1, c3 * 2 AS mc3 FROM t1"}})
        sql = self.to_sql(inmap)
        assert fix_indent(sql[0]) == "CREATE TABLE t1 (c1 integer, " \
            "c2 text, c3 integer)"
        assert fix_indent(sql[1]) == \
            "CREATE MATERIALIZED VIEW mv1 AS SELECT c1, c3 * 2 AS mc3 FROM t1"
dataset/ETHPy150Open perseas/Pyrseas/tests/dbobject/test_matview.py/MatViewToSqlTestCase.test_create_view/original