Skip to content

Commit

Permalink
flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre Verkest committed Feb 17, 2015
1 parent 763d99e commit 48225ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 5 additions & 4 deletions materialized_sql_view/model/abstract_materialized_sql_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,14 @@ def refresh_mat_view(self, cr, view_name, mat_view_name):

@abstractmethod
def drop_mat_view(self, cr, view_name, mat_view_name):
"""Abstract Method to overwrite in subclass to drop materialized view and clean
every thing to its authority
"""Abstract Method to overwrite in subclass to drop materialized view
and clean every thing to its authority
"""

def is_existed_relation(self, cr, relname):
cr.execute("select count(*) from pg_class where relname like '%(relname)s'" %
{'relname': relname})
cr.execute(
"select count(*) from pg_class where relname like '%(relname)s'" %
{'relname': relname})
return cr.fetchone()[0] > 0

@classmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ def test_materialized_view(self):

def test_is_existed_relation(self):
pg = self.pg_manager.getInstance(self.cr._cnx.server_version)
pg.create_mat_view(self.cr, self.sql, self.view_name, self.mat_view_name)
pg.create_mat_view(self.cr, self.sql, self.view_name,
self.mat_view_name)
self.assertTrue(pg.is_existed_relation(self.cr, self.view_name))
self.assertTrue(pg.is_existed_relation(self.cr, self.view_name))
pg.drop_mat_view(self.cr, self.view_name, self.mat_view_name)
Expand Down

0 comments on commit 48225ed

Please sign in to comment.