incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tvansteenbu...@apache.org
Subject [13/50] [abbrv] git commit: [#5112] ticket:270 Fixed failing tests due to milestone counts lazy load
Date Mon, 25 Feb 2013 21:56:17 GMT
[#5112] ticket:270 Fixed failing tests due to milestone counts lazy load


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

Branch: refs/heads/si/5453
Commit: 7f209c95206d896ee59e340d3db4143f1ba85699
Parents: fb84e07
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Fri Feb 15 12:51:45 2013 +0000
Committer: Cory Johns <johnsca@geek.net>
Committed: Wed Feb 20 23:45:37 2013 +0000

----------------------------------------------------------------------
 .../forgetracker/tests/functional/test_root.py     |   24 +++++++++-----
 1 files changed, 15 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7f209c95/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 0e9207f..47b2690 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -129,17 +129,23 @@ class TestFunctionalController(TrackerTestController):
         self.new_ticket(summary='test new with milestone', **{'_milestone':'1.0'})
         self.new_ticket(summary='test new with milestone', **{'_milestone':'1.0',
                                                               'private': '1'})
-        r = self.app.get('/bugs/')
-        assert '<small>2</small>' in r
+        r = self.app.get('/bugs/milestone_counts')
+        counts = {
+            'milestone_counts': [
+                {'name': '1.0', 'count': 2},
+                {'name': '2.0', 'count': 0}
+        ]}
+        assert_equal(r.body, json.dumps(counts))
         # Private tickets shouldn't be included in counts if user doesn't
         # have read access to private tickets.
-        r = self.app.get('/bugs/', extra_environ=dict(username='*anonymous'))
-        assert '<small>1</small>' in r
+        r = self.app.get('/bugs/milestone_counts',
+                extra_environ=dict(username='*anonymous'))
+        counts['milestone_counts'][0]['count'] = 1
+        assert_equal(r.body, json.dumps(counts))
 
         self.app.post('/bugs/1/delete')
-        r = self.app.get('/bugs/')
-        assert '<small>1</small>' in r
-
+        r = self.app.get('/bugs/milestone_counts')
+        assert_equal(r.body, json.dumps(counts))
 
     def test_milestone_progress(self):
         self.new_ticket(summary='Ticket 1', **{'_milestone':'1.0'})
@@ -266,9 +272,9 @@ class TestFunctionalController(TrackerTestController):
         assert_true(summary in ticket_view)
         index_view = self.app.get('/doc-bugs/')
         assert_true(summary in index_view)
-        assert_true(sidebar_contains(index_view, '<span class="has_small">1.0</span><small>1</small>'))
+        assert_true(sidebar_contains(index_view, '<span>1.0</span>'))
         index_view = self.app.get('/bugs/')
-        assert_false(sidebar_contains(index_view, '<span class="has_small">1.0</span><small>1</small>'))
+        assert_true(sidebar_contains(index_view, '<span>1.0</span>'))
         assert_false(summary in index_view)
 
     def test_render_ticket(self):


Mime
View raw message