allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hei...@apache.org
Subject [08/39] allura git commit: Fix randomly failing tests. rstrip() removes all chars, only need to remove / and if slug had "reply" chars in it, it would not be found
Date Tue, 02 Jun 2015 20:06:59 GMT
Fix randomly failing tests.  rstrip() removes all chars, only need to remove / and if slug
had "reply" chars in it, it would not be found


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/9e46b8af
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/9e46b8af
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/9e46b8af

Branch: refs/heads/hs/7825
Commit: 9e46b8afcdef593ba0559ae8cc2c28928ee75e08
Parents: e077943
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Thu May 28 20:11:01 2015 +0000
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Thu May 28 20:11:01 2015 +0000

----------------------------------------------------------------------
 Allura/allura/tests/functional/test_discuss.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/9e46b8af/Allura/allura/tests/functional/test_discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_discuss.py b/Allura/allura/tests/functional/test_discuss.py
index 74ca133..0063cb8 100644
--- a/Allura/allura/tests/functional/test_discuss.py
+++ b/Allura/allura/tests/functional/test_discuss.py
@@ -234,7 +234,7 @@ class TestDiscuss(TestController):
         r = self._make_post('This is a post')
         reply_form = r.html.find(
             'div', {'class': 'edit_post_form reply'}).find('form')
-        post_link = str(reply_form['action']).rstrip('/reply')
+        post_link = str(reply_form['action']).rstrip('/')
         _, slug = post_link.rsplit('/', 1)
         r = self.app.get(post_link, status=200)
         post = M.Post.query.get(slug=slug)
@@ -320,8 +320,9 @@ class TestAttachment(TestController):
         thumblink = alink + '/thumb'
         self.app.get(alink, status=200)
         self.app.get(thumblink, status=200)
-        _, slug = self.post_link.rstrip('/reply').rsplit('/', 1)
+        _, slug = self.post_link.rstrip('/').rsplit('/', 1)
         post = M.Post.query.get(slug=slug)
+        assert post, 'Could not find post for {} {}'.format(slug, self.post_link)
         post.deleted = True
         session(post).flush(post)
         self.app.get(alink, status=404)


Mime
View raw message