##// END OF EJS Templates
events: fix bug, 'url' was not in dict
dan -
r392:b65452d3 default
parent child Browse files
Show More
@@ -68,4 +68,4 b' class RhodecodeEvent(object):'
68 68 return '<no ip available>'
69 69
70 70 def as_dict(self):
71 return self.MarshmallowSchema().dump(self).data No newline at end of file
71 return self.MarshmallowSchema().dump(self).data
@@ -749,9 +749,10 b' class PullRequestModel(BaseModel):'
749 749 return ids_to_add, ids_to_remove
750 750
751 751 def get_url(self, pull_request):
752 return h.url('pullrequest_show', repo_name=self.target_repo.repo_name,
753 pull_request_id=self.pull_request_id,
754 qualified=True)
752 return h.url('pullrequest_show',
753 repo_name=pull_request.target_repo.repo_name,
754 pull_request_id=pull_request.pull_request_id,
755 qualified=True)
755 756
756 757 def notify_reviewers(self, pull_request, reviewers_ids):
757 758 # notification to reviewers
@@ -47,7 +47,7 b' def test_pullrequest_events_serialized(p'
47 47 assert data['name'] == EventClass.name
48 48 assert data['repo']['repo_name'] == pr.target_repo.repo_name
49 49 assert data['pullrequest']['pull_request_id'] == pr.pull_request_id
50
50 assert data['pullrequest']['url']
51 51
52 52 @pytest.mark.backends("git", "hg")
53 53 def test_create_pull_request_events(pr_util):
@@ -59,6 +59,7 b' def test_repo_events_serialized(repo_stu'
59 59 data = event.as_dict()
60 60 assert data['name'] == EventClass.name
61 61 assert data['repo']['repo_name'] == repo_stub.repo_name
62 assert data['repo']['url']
62 63
63 64
64 65 @pytest.mark.parametrize('EventClass', [
@@ -69,17 +70,19 b' def test_vcs_repo_events_serialize(repo_'
69 70 data = event.as_dict()
70 71 assert data['name'] == EventClass.name
71 72 assert data['repo']['repo_name'] == repo_stub.repo_name
73 assert data['repo']['url']
72 74
73 75
74 76
75 77 @pytest.mark.parametrize('EventClass', [RepoPushEvent])
76 def test_vcs_repo_events_serialize(repo_stub, scm_extras, EventClass):
78 def test_vcs_repo_push_event_serialize(repo_stub, scm_extras, EventClass):
77 79 event = EventClass(repo_name=repo_stub.repo_name,
78 80 pushed_commit_ids=scm_extras['commit_ids'],
79 81 extras=scm_extras)
80 82 data = event.as_dict()
81 83 assert data['name'] == EventClass.name
82 84 assert data['repo']['repo_name'] == repo_stub.repo_name
85 assert data['repo']['url']
83 86
84 87
85 88 def test_create_delete_repo_fires_events(backend):
General Comments 0
You need to be logged in to leave comments. Login now