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/04/08 17:19:35 UTC
[34/50] [abbrv] 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/43731d37
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/43731d37
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/43731d37
Branch: refs/heads/db/6007
Commit: 43731d379ffeec3a65155cd652187cd6f6e67f67
Parents: 719ec68
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Tue Mar 12 20:04:01 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Apr 4 18:37:37 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/43731d37/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/43731d37/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 1613cf9..676a887 100644
--- a/ForgeSVN/forgesvn/tests/model/test_repository.py
+++ b/ForgeSVN/forgesvn/tests/model/test_repository.py
@@ -519,8 +519,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)
@@ -530,8 +534,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) ]
@@ -545,13 +549,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()