You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2016/08/01 18:07:52 UTC

[2/5] allura git commit: Updated Tests to match changes

Updated Tests to match changes


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

Branch: refs/heads/master
Commit: 5af758c62c13c1d265880bc2e5814e8c65dbbd97
Parents: 8e02607
Author: Rohan Verma <ro...@gmail.com>
Authored: Wed Jul 13 18:21:22 2016 +0530
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Mon Aug 1 14:02:27 2016 -0400

----------------------------------------------------------------------
 Allura/allura/tests/functional/test_discuss.py          |  8 ++++----
 ForgeTracker/forgetracker/tests/functional/test_root.py | 11 ++++++-----
 2 files changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/5af758c6/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 d9fe37b..c18a330 100644
--- a/Allura/allura/tests/functional/test_discuss.py
+++ b/Allura/allura/tests/functional/test_discuss.py
@@ -321,7 +321,7 @@ class TestAttachment(TestDiscussBase):
         r = self.app.post(self.post_link + 'attach',
                           upload_files=[('file_info', 'test.txt', 'HiThere!')])
         r = self.app.get(self.thread_link)
-        assert '<div class="attachment_thumb">' in r
+        assert '<div class="attachment_holder">' in r
         alink = self.attach_link()
         r = self.app.get(alink)
         assert r.content_type == 'text/plain'
@@ -396,7 +396,7 @@ class TestAttachment(TestDiscussBase):
             upload_files=[('file_info', 'user.png', pic)])
         # ... make sure ordinary user can see it
         r = self.app.get(self.thread_link, extra_environ=ordinary_user)
-        assert '<div class="attachment_thumb">' in r
+        assert '<div class="attachment_holder">' in r
         alink = self.attach_link()
         thumblink = alink + '/thumb'
         # ... and access it
@@ -411,10 +411,10 @@ class TestAttachment(TestDiscussBase):
         session(post).flush(post)
         # ... make sure attachment is not visible to ordinary user
         r = self.app.get(self.thread_link, extra_environ=ordinary_user)
-        assert '<div class="attachment_thumb">' not in r, 'Attachment is visible on unmoderated post'
+        assert '<div class="attachment_holder">' not in r, 'Attachment is visible on unmoderated post'
         # ... but visible to moderator
         r = self.app.get(self.thread_link, extra_environ=moderator)
-        assert '<div class="attachment_thumb">' in r
+        assert '<div class="attachment_holder">' in r
         # ... and ordinary user can't access it
         self.app.get(alink, status=403, extra_environ=ordinary_user)
         self.app.get(thumblink, status=403, extra_environ=ordinary_user)

http://git-wip-us.apache.org/repos/asf/allura/blob/5af758c6/ForgeTracker/forgetracker/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_root.py b/ForgeTracker/forgetracker/tests/functional/test_root.py
index 1bffbe3..77a563b 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -882,10 +882,10 @@ class TestFunctionalController(TrackerTestController):
         self.app.post(post_link + 'attach',
                       upload_files=[('file_info', 'test.txt', 'HiThere!')])
         r = self.app.get('/bugs/1/', dict(page=1))
-        assert '<input class="submit delete_attachment file" type="submit" value="X"/>' in r
+        assert '<i class="fa fa-trash-o" aria-hidden="true"></i>' in r
         r.forms[5].submit()
         r = self.app.get('/bugs/1/', dict(page=1))
-        assert '<input class="submit delete_attachment" type="submit" value="X"/>' not in r
+        assert '<i class="fa fa-trash-o" aria-hidden="true"></i>' not in r
 
     def test_new_text_attachment_content(self):
         file_name = 'test_root.py'
@@ -2279,9 +2279,10 @@ class TestFunctionalController(TrackerTestController):
         r = self.app.post('/p/test/bugs/1/move/',
                           params={'tracker': str(bugs2.config._id)}).follow()
 
-        attachs = r.html.findAll('div', attrs={'class': 'attachment_thumb'})
-        ta = str(attachs[1])  # ticket's attachments
-        ca = str(attachs[2])  # comment's attachments
+        attach_tickets = r.html.findAll('div', attrs={'class': 'attachment_thumb'})
+        attach_comments = r.html.findAll('div', attrs={'class': 'attachment_item'})
+        ta = str(attach_tickets)  # ticket's attachments
+        ca = str(attach_comments)  # comment's attachments
         assert_in('<a href="/p/test2/bugs2/1/attachment/neo-icon-set-454545-256x350.png"', ta)
         assert_in('<img src="/p/test2/bugs2/1/attachment/neo-icon-set-454545-256x350.png/thumb"', ta)
         p = M.Post.query.find().sort('timestamp', 1).first()