def test_create_view(self):
        inmap = self.std_map()
        inmap['schema public'].update({'view v1': {
            'definition': " SELECT now()::date AS today;",
            'owner': self.db.user,
            'privileges': [{self.db.user: ['all']}, {'user1': ['select']}]}})
        sql = self.to_sql(inmap)
        # sql[0] = CREATE VIEW
        # sql[1] = ALTER VIEW OWNER
        assert sql[2] == "GRANT ALL ON TABLE v1 TO %s" % self.db.user
        assert sql[3] == "GRANT SELECT ON TABLE v1 TO user1"
Create a view with some privileges
dataset/ETHPy150Open perseas/Pyrseas/tests/dbobject/test_privs.py/PrivilegeToSqlTestCase.test_create_view