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 2012/10/02 23:30:28 UTC
[11/34] git commit: [#5022] Fixed failing test due to new arg
[#5022] Fixed failing test due to new arg
Signed-off-by: Cory Johns <jo...@geek.net>
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/0298d850
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/0298d850
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/0298d850
Branch: refs/heads/db/4968
Commit: 0298d85091dd970b0c6d57c914e43643b604a6a8
Parents: fbf2b30
Author: Cory Johns <jo...@geek.net>
Authored: Mon Oct 1 17:15:15 2012 +0000
Committer: Dave Brondsema <db...@geek.net>
Committed: Tue Oct 2 13:31:59 2012 +0000
----------------------------------------------------------------------
Allura/allura/tests/test_tasks.py | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0298d850/Allura/allura/tests/test_tasks.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_tasks.py b/Allura/allura/tests/test_tasks.py
index 580b7f0..1c52478 100644
--- a/Allura/allura/tests/test_tasks.py
+++ b/Allura/allura/tests/test_tasks.py
@@ -6,6 +6,9 @@ import unittest
from base64 import b64encode
import mock
+import pylons
+pylons.c = pylons.tmpl_context
+pylons.g = pylons.app_globals
from pylons import c, g
from datadiff.tools import assert_equal
from nose.tools import assert_in
@@ -205,10 +208,11 @@ class TestRepoTasks(unittest.TestCase):
def test_clone(self):
ns = M.Notification.query.find().count()
with mock.patch.object(c.app.repo, 'init_as_clone') as f:
- repo_tasks.clone('foo', 'bar', 'baz')
- M.main_orm_session.flush()
- f.assert_called_with('foo', 'bar', 'baz')
- assert ns + 1 == M.Notification.query.find().count()
+ with mock.patch.object(mail_tasks.smtp_client, '_client') as _client:
+ repo_tasks.clone('foo', 'bar', 'baz')
+ M.main_orm_session.flush()
+ f.assert_called_with('foo', 'bar', 'baz', False)
+ assert ns + 1 == M.Notification.query.find().count()
def test_refresh(self):
with mock.patch.object(c.app.repo, 'refresh') as f: