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 2013/03/28 17:57:59 UTC
[30/42] git commit: [#5453] Fix svn test to work with user stats
[#5453] Fix svn test to work with user stats
Signed-off-by: Tim Van Steenburgh <tv...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/5d9da324
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/5d9da324
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/5d9da324
Branch: refs/heads/db/5453
Commit: 5d9da324f1528bdbebadd92eeb3d31518cd6539d
Parents: df9c974
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Tue Mar 12 20:04:01 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Mar 28 16:53:33 2013 +0000
----------------------------------------------------------------------
Allura/allura/model/contrib_stats.py | 2 +-
ForgeSVN/forgesvn/tests/model/test_repository.py | 14 +++++++++-----
2 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/5d9da324/Allura/allura/model/contrib_stats.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/contrib_stats.py b/Allura/allura/model/contrib_stats.py
index 5a4751a..3799ea5 100644
--- a/Allura/allura/model/contrib_stats.py
+++ b/Allura/allura/model/contrib_stats.py
@@ -16,7 +16,7 @@ from allura.lib import helpers as h
class Stats(MappedClass):
class __mongometa__:
- name='userstats'
+ name='basestats'
session = main_orm_session
unique_indexes = [ '_id']
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/5d9da324/ForgeSVN/forgesvn/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/model/test_repository.py b/ForgeSVN/forgesvn/tests/model/test_repository.py
index 43d6cbc..100fa0b 100644
--- a/ForgeSVN/forgesvn/tests/model/test_repository.py
+++ b/ForgeSVN/forgesvn/tests/model/test_repository.py
@@ -518,8 +518,12 @@ class TestRepo(_TestWithRepo):
assert self.repo.guess_type('.gitignore') == ('text/plain', None)
def test_refresh(self):
+ committer_name = 'Test Committer'
+ committer_email = 'test@example.com'
ci = mock.Mock()
- ci.authored.name = 'Test Committer'
+ ci.authored.name = committer_name
+ ci.committed.name = committer_name
+ ci.committed.email = committer_email
ci.author_url = '/u/test-committer/'
self.repo.count_revisions=mock.Mock(return_value=100)
self.repo._impl.commit = mock.Mock(return_value=ci)
@@ -529,8 +533,8 @@ class TestRepo(_TestWithRepo):
def refresh_commit_info(oid, seen, lazy=False):
M.repo.CommitDoc(dict(
authored=dict(
- name='Test Committer',
- email='test@test.com'),
+ name=committer_name,
+ email=committer_email),
_id=oid)).m.insert()
def set_heads():
self.repo.heads = [ ming.base.Object(name='head', object_id='foo0', count=100) ]
@@ -544,13 +548,13 @@ class TestRepo(_TestWithRepo):
notifications = M.Notification.query.find().all()
for n in notifications:
if '100 new commits' in n.subject:
- assert "master,branch: by Test Committer http://localhost/ci/foo99" in n.text
+ assert "master,branch: by %s http://localhost/ci/foo99" % committer_name in n.text
break
else:
assert False, 'Did not find notification'
assert M.Feed.query.find(dict(
title='New commit',
- author_name='Test Committer')).count()
+ author_name=committer_name)).count()
def test_refresh_private(self):
ci = mock.Mock()