tests: fixed some tests

This commit is contained in:
RhodeCode Admin 2021-07-16 16:23:02 +02:00
parent 5df5d7893b
commit 3a64e09b7b
2 changed files with 4 additions and 3 deletions

View file

@ -20,6 +20,7 @@
import pytest
from rhodecode.events import UserPermissionsChange
from rhodecode.lib.utils2 import StrictAttributeDict
from rhodecode.tests.events.conftest import EventCatcher
@ -97,7 +98,7 @@ def test_vcs_repo_push_event_serialize(config_stub, repo_stub, scm_extras, Event
def test_create_delete_repo_fires_events(backend):
with EventCatcher() as event_catcher:
repo = backend.create_repo()
assert event_catcher.events_types == [RepoPreCreateEvent, RepoCreateEvent]
assert event_catcher.events_types == [RepoPreCreateEvent, RepoCreateEvent, UserPermissionsChange]
with EventCatcher() as event_catcher:
RepoModel().delete(repo)

View file

@ -127,7 +127,7 @@ class TestPullRequestModel(object):
Session().commit()
prs = PullRequestModel().get_awaiting_my_review(
pull_request.target_repo, user_id=pull_request.author.user_id)
pull_request.target_repo.repo_name, user_id=pull_request.author.user_id)
assert isinstance(prs, list)
assert len(prs) == 1
@ -138,7 +138,7 @@ class TestPullRequestModel(object):
Session().commit()
pr_count = PullRequestModel().count_awaiting_my_review(
pull_request.target_repo, user_id=pull_request.author.user_id)
pull_request.target_repo.repo_name, user_id=pull_request.author.user_id)
assert pr_count == 1
def test_delete_calls_cleanup_merge(self, pull_request):