#NEWLINE# def test_map_view( self ) : #NEWLINE# #INDENT# 'Map a view with various GRANTs' #NEWLINE# stmts = [ 'CREATE VIEW v1 AS SELECT now()::date AS today' , 'GRANT SELECT ON v1 TO PUBLIC' , 'GRANT REFERENCES ON v1 TO user1' ] #NEWLINE# dbmap = self . to_map ( stmts , no_privs = False ) #NEWLINE# expmap = { #NEWLINE# #INDENT# 'definition' : ' SELECT now()::date AS today;' , #NEWLINE# 'privileges' : [ { #NEWLINE# #INDENT# self . db . user : [ 'all' ] , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'PUBLIC' : [ 'select' ] , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'user1' : [ 'references' ] , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } #NEWLINE# assert ( dbmap [ 'schema public' ] [ 'view v1' ] == self )