Return-Path: X-Original-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2C1F1E053 for ; Wed, 20 Feb 2013 23:51:24 +0000 (UTC) Received: (qmail 99930 invoked by uid 500); 20 Feb 2013 23:51:24 -0000 Delivered-To: apmail-incubator-allura-commits-archive@incubator.apache.org Received: (qmail 99914 invoked by uid 500); 20 Feb 2013 23:51:24 -0000 Mailing-List: contact allura-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: allura-dev@incubator.apache.org Delivered-To: mailing list allura-commits@incubator.apache.org Received: (qmail 99905 invoked by uid 99); 20 Feb 2013 23:51:24 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Feb 2013 23:51:24 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id A2CB882D91C; Wed, 20 Feb 2013 23:51:23 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: johnsca@apache.org To: allura-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [1/2] git commit: [#5112] ticket:270 Fixed failing tests due to milestone counts lazy load Message-Id: <20130220235123.A2CB882D91C@tyr.zones.apache.org> Date: Wed, 20 Feb 2013 23:51:23 +0000 (UTC) [#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/master Commit: 7f209c95206d896ee59e340d3db4143f1ba85699 Parents: fb84e07 Author: Igor Bondarenko Authored: Fri Feb 15 12:51:45 2013 +0000 Committer: Cory Johns 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 '2' 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 '1' 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 '1' 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, '1.01')) + assert_true(sidebar_contains(index_view, '1.0')) index_view = self.app.get('/bugs/') - assert_false(sidebar_contains(index_view, '1.01')) + assert_true(sidebar_contains(index_view, '1.0')) assert_false(summary in index_view) def test_render_ticket(self):