# HG changeset patch # User Sylvain Thénault # Date 1249646403 -7200 # Node ID e73118788a56782452fadcbc6a5129c15c34192a # Parent c28b5f16f3afc0e5bf1e737fb518759cd1c4d301 remove code unused for a while now diff -r c28b5f16f3af -r e73118788a56 devtools/_apptest.py --- a/devtools/_apptest.py Fri Aug 07 13:59:38 2009 +0200 +++ b/devtools/_apptest.py Fri Aug 07 14:00:03 2009 +0200 @@ -65,6 +65,7 @@ global SYSTEM_RELATIONS SYSTEM_RELATIONS += relations + class TestEnvironment(object): """TestEnvironment defines a context (e.g. a config + a given connection) in which the tests are executed @@ -176,55 +177,6 @@ return (self.execute(rql, args, eidkey), self.create_request(rql=rql, **optional_args or {})) - def check_view(self, rql, vid, optional_args, template='main'): - """checks if rendering view raises an exception in this environment - - If any exception is raised in this method, it will be considered - as a TestFailure - """ - return self.call_view(vid, rql, - template=template, optional_args=optional_args) - - def call_view(self, vid, rql, template='main', optional_args=None): - assert template - if optional_args is None: - optional_args = {} - optional_args['vid'] = vid - req = self.create_request(rql=rql, **optional_args) - return self.vreg['views'].main_template(req, template) - - def call_edit(self, req): - """shortcut for self.app.edit()""" - controller = self.vreg.select('controllers', 'edit', req) - try: - controller.publish() - except Redirect: - result = 'success' - else: - raise Exception('edit should raise Redirect on success') - req.cnx.commit() - return result - - def iter_possible_views(self, req, rset): - """returns a list of possible vids for """ - for view in self.vreg['views'].possible_views(req, rset): - if view.category == 'startupview': - continue - yield view.id - if rset.rowcount == 1: - yield 'edition' - - def iter_startup_views(self, req): - """returns the list of startup views""" - for view in self.vreg['views'].possible_views(req, None): - if view.category != 'startupview': - continue - yield view.id - - def iter_possible_actions(self, req, rset): - """returns a list of possible vids for """ - for action in self.vreg.possible_vobjects('actions', req, rset=rset): - yield action class ExistingTestEnvironment(TestEnvironment):