You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2013/05/28 18:01:11 UTC
[19/50] git commit: [#6125] ticket:342 tests for git repository
commit emails
[#6125] ticket:342 tests for git repository commit emails
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/22cb1a01
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/22cb1a01
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/22cb1a01
Branch: refs/heads/cj/5913
Commit: 22cb1a01d3ec16253b53bad078279c43b647d797
Parents: c42a258
Author: Yuriy Arhipov <yu...@yandex.ru>
Authored: Wed May 15 09:00:17 2013 +0400
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Thu May 23 19:46:06 2013 +0000
----------------------------------------------------------------------
ForgeGit/forgegit/tests/model/test_repository.py | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/22cb1a01/ForgeGit/forgegit/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/model/test_repository.py b/ForgeGit/forgegit/tests/model/test_repository.py
index 1e472b3..150b6e2 100644
--- a/ForgeGit/forgegit/tests/model/test_repository.py
+++ b/ForgeGit/forgegit/tests/model/test_repository.py
@@ -35,6 +35,7 @@ from allura.lib import helpers as h
from allura.tests import decorators as td
from allura.tests.model.test_repo import RepoImplTestBase
from allura import model as M
+from allura.model.repo_refresh import send_notifications
from forgegit import model as GM
from forgegit.tests import with_git
from forgewiki import model as WM
@@ -258,6 +259,19 @@ class TestGitRepo(unittest.TestCase, RepoImplTestBase):
self.assertEqual(new_tree.blob_ids, orig_tree.blob_ids)
self.assertEqual(new_tree.other_ids, orig_tree.other_ids)
+ def test_notification_email(self):
+ send_notifications(self.repo, ['1e146e67985dcd71c74de79613719bef7bddca4a', ])
+ ThreadLocalORMSession.flush_all()
+ notifications = M.Notification.query.find().sort('pubdate')
+ n = notifications.all()[2]
+ assert_equal(n.subject, '[test:src-git] Rick Copeland committed revision 1e146e67985dcd71c74de79613719bef7bddca4a: Change README')
+ assert 'master,zz: ' in n.text
+ send_notifications(self.repo, ['1e146e67985dcd71c74de79613719bef7bddca4a', 'df30427c488aeab84b2352bdf88a3b19223f9d7a'])
+ ThreadLocalORMSession.flush_all()
+ notifications = M.Notification.query.find().sort('pubdate')
+ n = notifications.all()[3]
+ assert_equal(n.subject, '[test:src-git] 2 new commits to test Git')
+
def test_tarball(self):
tmpdir = tg.config['scm.repos.tarball.root']
if os.path.isfile(os.path.join(tmpdir, "git/t/te/test/testgit.git/test-src-git-HEAD.zip")):