mirror of https://github.com/go-gitea/gitea
rewrite test
This commit is contained in:
parent
38f4b6680b
commit
330c3f8f5d
|
@ -1,150 +1,150 @@
|
|||
-
|
||||
id: 1
|
||||
user_id: 2
|
||||
repo_id: 3
|
||||
user_id: 1
|
||||
repo_id: 60
|
||||
mode: 4
|
||||
|
||||
-
|
||||
id: 2
|
||||
user_id: 2
|
||||
repo_id: 5
|
||||
repo_id: 3
|
||||
mode: 4
|
||||
|
||||
-
|
||||
id: 3
|
||||
user_id: 2
|
||||
repo_id: 5
|
||||
mode: 4
|
||||
|
||||
-
|
||||
id: 4
|
||||
user_id: 2
|
||||
repo_id: 24
|
||||
mode: 2
|
||||
|
||||
-
|
||||
id: 4
|
||||
id: 5
|
||||
user_id: 2
|
||||
repo_id: 32
|
||||
mode: 4
|
||||
|
||||
-
|
||||
id: 5
|
||||
id: 6
|
||||
user_id: 4
|
||||
repo_id: 3
|
||||
mode: 2
|
||||
|
||||
-
|
||||
id: 6
|
||||
id: 7
|
||||
user_id: 4
|
||||
repo_id: 4
|
||||
mode: 2
|
||||
|
||||
-
|
||||
id: 7
|
||||
id: 8
|
||||
user_id: 4
|
||||
repo_id: 40
|
||||
mode: 2
|
||||
|
||||
-
|
||||
id: 8
|
||||
id: 9
|
||||
user_id: 12
|
||||
repo_id: 59
|
||||
mode: 4
|
||||
|
||||
-
|
||||
id: 10
|
||||
user_id: 15
|
||||
repo_id: 21
|
||||
mode: 2
|
||||
|
||||
-
|
||||
id: 9
|
||||
id: 11
|
||||
user_id: 15
|
||||
repo_id: 22
|
||||
mode: 2
|
||||
|
||||
-
|
||||
id: 10
|
||||
id: 12
|
||||
user_id: 15
|
||||
repo_id: 23
|
||||
mode: 4
|
||||
|
||||
-
|
||||
id: 11
|
||||
id: 13
|
||||
user_id: 15
|
||||
repo_id: 24
|
||||
mode: 4
|
||||
|
||||
-
|
||||
id: 12
|
||||
id: 14
|
||||
user_id: 15
|
||||
repo_id: 32
|
||||
mode: 2
|
||||
|
||||
-
|
||||
id: 13
|
||||
id: 15
|
||||
user_id: 18
|
||||
repo_id: 21
|
||||
mode: 2
|
||||
|
||||
-
|
||||
id: 14
|
||||
id: 16
|
||||
user_id: 18
|
||||
repo_id: 22
|
||||
mode: 2
|
||||
|
||||
-
|
||||
id: 15
|
||||
id: 17
|
||||
user_id: 18
|
||||
repo_id: 23
|
||||
mode: 4
|
||||
|
||||
-
|
||||
id: 16
|
||||
id: 18
|
||||
user_id: 18
|
||||
repo_id: 24
|
||||
mode: 4
|
||||
|
||||
-
|
||||
id: 17
|
||||
id: 19
|
||||
user_id: 20
|
||||
repo_id: 24
|
||||
mode: 1
|
||||
|
||||
-
|
||||
id: 18
|
||||
id: 20
|
||||
user_id: 20
|
||||
repo_id: 27
|
||||
mode: 4
|
||||
|
||||
-
|
||||
id: 19
|
||||
id: 21
|
||||
user_id: 20
|
||||
repo_id: 28
|
||||
mode: 4
|
||||
|
||||
-
|
||||
id: 20
|
||||
id: 22
|
||||
user_id: 29
|
||||
repo_id: 4
|
||||
mode: 2
|
||||
|
||||
-
|
||||
id: 21
|
||||
id: 23
|
||||
user_id: 29
|
||||
repo_id: 24
|
||||
mode: 1
|
||||
|
||||
-
|
||||
id: 22
|
||||
id: 24
|
||||
user_id: 31
|
||||
repo_id: 27
|
||||
mode: 4
|
||||
|
||||
-
|
||||
id: 23
|
||||
id: 25
|
||||
user_id: 31
|
||||
repo_id: 28
|
||||
mode: 4
|
||||
|
||||
-
|
||||
id: 24
|
||||
user_id: 40
|
||||
repo_id: 61
|
||||
mode: 4
|
||||
|
||||
-
|
||||
id: 25
|
||||
user_id: 41
|
||||
repo_id: 62
|
||||
mode: 1
|
||||
|
||||
|
|
|
@ -48,264 +48,264 @@
|
|||
|
||||
-
|
||||
id: 5
|
||||
repo_id: 59
|
||||
repo_id: 10
|
||||
name: 'master'
|
||||
commit_id: '65f1bf27bc3bf70f64657658635e66094edbcb4d'
|
||||
commit_message: 'Initial commit'
|
||||
commit_time: 1489927679
|
||||
pusher_id: 39
|
||||
pusher_id: 12
|
||||
is_deleted: false
|
||||
deleted_by_id: 0
|
||||
deleted_unix: 0
|
||||
|
||||
-
|
||||
id: 6
|
||||
repo_id: 59
|
||||
repo_id: 10
|
||||
name: 'new-commit'
|
||||
commit_id: 'cb24c347e328d83c1e0c3c908a6b2c0a2fcb8a3d'
|
||||
commit_message: 'add'
|
||||
commit_time: 1489927680
|
||||
pusher_id: 39
|
||||
pusher_id: 12
|
||||
is_deleted: false
|
||||
deleted_by_id: 0
|
||||
deleted_unix: 0
|
||||
|
||||
-
|
||||
id: 7
|
||||
repo_id: 59
|
||||
repo_id: 10
|
||||
name: 'no-commit'
|
||||
commit_id: '65f1bf27bc3bf70f64657658635e66094edbcb4d'
|
||||
commit_message: 'Initial commit'
|
||||
commit_time: 1489927679
|
||||
pusher_id: 39
|
||||
pusher_id: 12
|
||||
is_deleted: false
|
||||
deleted_by_id: 0
|
||||
deleted_unix: 0
|
||||
|
||||
-
|
||||
id: 8
|
||||
repo_id: 59
|
||||
repo_id: 10
|
||||
name: 'opening-pr'
|
||||
commit_id: 'cb24c347e328d83c1e0c3c908a6b2c0a2fcb8a3d'
|
||||
commit_message: 'add'
|
||||
commit_time: 1489927680
|
||||
pusher_id: 39
|
||||
pusher_id: 12
|
||||
is_deleted: false
|
||||
deleted_by_id: 0
|
||||
deleted_unix: 0
|
||||
|
||||
-
|
||||
id: 9
|
||||
repo_id: 59
|
||||
repo_id: 10
|
||||
name: 'closed-pr'
|
||||
commit_id: 'cb24c347e328d83c1e0c3c908a6b2c0a2fcb8a3d'
|
||||
commit_message: 'add'
|
||||
commit_time: 1489927680
|
||||
pusher_id: 39
|
||||
pusher_id: 12
|
||||
is_deleted: false
|
||||
deleted_by_id: 0
|
||||
deleted_unix: 0
|
||||
|
||||
-
|
||||
id: 10
|
||||
repo_id: 59
|
||||
repo_id: 10
|
||||
name: 'merged-pr'
|
||||
commit_id: 'cb24c347e328d83c1e0c3c908a6b2c0a2fcb8a3d'
|
||||
commit_message: 'add'
|
||||
commit_time: 1489927680
|
||||
pusher_id: 39
|
||||
pusher_id: 12
|
||||
is_deleted: false
|
||||
deleted_by_id: 0
|
||||
deleted_unix: 0
|
||||
|
||||
-
|
||||
id: 11
|
||||
repo_id: 59
|
||||
repo_id: 10
|
||||
name: 'closed-pr-with-deleted-branch'
|
||||
commit_id: 'cb24c347e328d83c1e0c3c908a6b2c0a2fcb8a3d'
|
||||
commit_message: 'add'
|
||||
commit_time: 1489927680
|
||||
pusher_id: 39
|
||||
pusher_id: 12
|
||||
is_deleted: true
|
||||
deleted_by_id: 39
|
||||
deleted_by_id: 12
|
||||
deleted_unix: 1489927700
|
||||
|
||||
-
|
||||
id: 12
|
||||
repo_id: 59
|
||||
repo_id: 10
|
||||
name: 'merged-pr-with-deleted-branch'
|
||||
commit_id: 'cb24c347e328d83c1e0c3c908a6b2c0a2fcb8a3d'
|
||||
commit_message: 'add'
|
||||
commit_time: 1489927680
|
||||
pusher_id: 39
|
||||
pusher_id: 12
|
||||
is_deleted: true
|
||||
deleted_by_id: 39
|
||||
deleted_by_id: 12
|
||||
deleted_unix: 1489927700
|
||||
|
||||
-
|
||||
id: 13
|
||||
repo_id: 59
|
||||
repo_id: 10
|
||||
name: 'deleted-branch'
|
||||
commit_id: 'cb24c347e328d83c1e0c3c908a6b2c0a2fcb8a3d'
|
||||
commit_message: 'add'
|
||||
commit_time: 1489927680
|
||||
pusher_id: 39
|
||||
pusher_id: 12
|
||||
is_deleted: true
|
||||
deleted_by_id: 39
|
||||
deleted_by_id: 12
|
||||
deleted_unix: 1489927700
|
||||
|
||||
-
|
||||
id: 14
|
||||
repo_id: 60
|
||||
repo_id: 11
|
||||
name: 'master'
|
||||
commit_id: '65f1bf27bc3bf70f64657658635e66094edbcb4d'
|
||||
commit_message: 'Initial commit'
|
||||
commit_time: 1489927679
|
||||
pusher_id: 40
|
||||
pusher_id: 13
|
||||
is_deleted: false
|
||||
deleted_by_id: 0
|
||||
deleted_unix: 0
|
||||
|
||||
-
|
||||
id: 15
|
||||
repo_id: 60
|
||||
repo_id: 11
|
||||
name: 'user-fork-new-commit'
|
||||
commit_id: 'cb24c347e328d83c1e0c3c908a6b2c0a2fcb8a3d'
|
||||
commit_message: 'add'
|
||||
commit_time: 1489927680
|
||||
pusher_id: 40
|
||||
pusher_id: 13
|
||||
is_deleted: false
|
||||
deleted_by_id: 0
|
||||
deleted_unix: 0
|
||||
|
||||
-
|
||||
id: 16
|
||||
repo_id: 60
|
||||
repo_id: 11
|
||||
name: 'user-fork-no-commit'
|
||||
commit_id: '65f1bf27bc3bf70f64657658635e66094edbcb4d'
|
||||
commit_message: 'Initial commit'
|
||||
commit_time: 1489927679
|
||||
pusher_id: 40
|
||||
pusher_id: 13
|
||||
is_deleted: false
|
||||
deleted_by_id: 0
|
||||
deleted_unix: 0
|
||||
|
||||
-
|
||||
id: 17
|
||||
repo_id: 61
|
||||
repo_id: 59
|
||||
name: 'master'
|
||||
commit_id: '65f1bf27bc3bf70f64657658635e66094edbcb4d'
|
||||
commit_message: 'Initial commit'
|
||||
commit_time: 1489927679
|
||||
pusher_id: 39
|
||||
pusher_id: 12
|
||||
is_deleted: false
|
||||
deleted_by_id: 0
|
||||
deleted_unix: 0
|
||||
|
||||
-
|
||||
id: 18
|
||||
repo_id: 61
|
||||
repo_id: 59
|
||||
name: 'org-fork-new-commit'
|
||||
commit_id: 'cb24c347e328d83c1e0c3c908a6b2c0a2fcb8a3d'
|
||||
commit_message: 'add'
|
||||
commit_time: 1489927691
|
||||
pusher_id: 39
|
||||
pusher_id: 12
|
||||
is_deleted: false
|
||||
deleted_by_id: 0
|
||||
deleted_unix: 0
|
||||
|
||||
-
|
||||
id: 19
|
||||
repo_id: 61
|
||||
repo_id: 59
|
||||
name: 'org-fork-no-commit'
|
||||
commit_id: '65f1bf27bc3bf70f64657658635e66094edbcb4d'
|
||||
commit_message: 'Initial commit'
|
||||
commit_time: 1489927691
|
||||
pusher_id: 39
|
||||
pusher_id: 12
|
||||
is_deleted: false
|
||||
deleted_by_id: 0
|
||||
deleted_unix: 0
|
||||
|
||||
-
|
||||
id: 20
|
||||
repo_id: 62
|
||||
repo_id: 60
|
||||
name: 'master'
|
||||
commit_id: '65f1bf27bc3bf70f64657658635e66094edbcb4d'
|
||||
commit_message: 'Initial commit'
|
||||
commit_time: 1489927679
|
||||
pusher_id: 41
|
||||
pusher_id: 1
|
||||
is_deleted: false
|
||||
deleted_by_id: 0
|
||||
deleted_unix: 0
|
||||
|
||||
-
|
||||
id: 21
|
||||
repo_id: 62
|
||||
repo_id: 60
|
||||
name: 'private-org-fork-new-commit'
|
||||
commit_id: 'cb24c347e328d83c1e0c3c908a6b2c0a2fcb8a3d'
|
||||
commit_message: 'add'
|
||||
commit_time: 1489927680
|
||||
pusher_id: 41
|
||||
pusher_id: 1
|
||||
is_deleted: false
|
||||
deleted_by_id: 0
|
||||
deleted_unix: 0
|
||||
|
||||
-
|
||||
id: 22
|
||||
repo_id: 62
|
||||
repo_id: 60
|
||||
name: 'private-org-fork-no-commit'
|
||||
commit_id: '65f1bf27bc3bf70f64657658635e66094edbcb4d'
|
||||
commit_message: 'Initial commit'
|
||||
commit_time: 1489927679
|
||||
pusher_id: 41
|
||||
pusher_id: 1
|
||||
is_deleted: false
|
||||
deleted_by_id: 0
|
||||
deleted_unix: 0
|
||||
|
||||
-
|
||||
id: 23
|
||||
repo_id: 62
|
||||
repo_id: 60
|
||||
name: 'private-org-fork-no-permission-new-commit'
|
||||
commit_id: 'cb24c347e328d83c1e0c3c908a6b2c0a2fcb8a3d'
|
||||
commit_message: 'add'
|
||||
commit_time: 1489927680
|
||||
pusher_id: 42
|
||||
pusher_id: 2
|
||||
is_deleted: false
|
||||
deleted_by_id: 0
|
||||
deleted_unix: 0
|
||||
|
||||
-
|
||||
id: 24
|
||||
repo_id: 62
|
||||
repo_id: 60
|
||||
name: 'private-org-fork-no-permission-no-commit'
|
||||
commit_id: '65f1bf27bc3bf70f64657658635e66094edbcb4d'
|
||||
commit_message: 'Initial commit'
|
||||
commit_time: 1489927679
|
||||
pusher_id: 42
|
||||
pusher_id: 2
|
||||
is_deleted: false
|
||||
deleted_by_id: 0
|
||||
deleted_unix: 0
|
||||
|
||||
-
|
||||
id: 25
|
||||
repo_id: 59
|
||||
repo_id: 10
|
||||
name: 'same-name-branch-in-pr'
|
||||
commit_id: 'cb24c347e328d83c1e0c3c908a6b2c0a2fcb8a3d'
|
||||
commit_message: 'add'
|
||||
commit_time: 1489927680
|
||||
pusher_id: 40
|
||||
pusher_id: 13
|
||||
is_deleted: false
|
||||
deleted_by_id: 0
|
||||
deleted_unix: 0
|
||||
|
||||
-
|
||||
id: 26
|
||||
repo_id: 60
|
||||
repo_id: 11
|
||||
name: 'same-name-branch-in-pr'
|
||||
commit_id: 'cb24c347e328d83c1e0c3c908a6b2c0a2fcb8a3d'
|
||||
commit_message: 'add'
|
||||
commit_time: 1489927680
|
||||
pusher_id: 40
|
||||
pusher_id: 13
|
||||
is_deleted: false
|
||||
deleted_by_id: 0
|
||||
deleted_unix: 0
|
||||
|
|
|
@ -324,9 +324,9 @@
|
|||
|
||||
-
|
||||
id: 20
|
||||
repo_id: 59
|
||||
index: 1
|
||||
poster_id: 39
|
||||
repo_id: 10
|
||||
index: 2
|
||||
poster_id: 12
|
||||
original_author_id: 0
|
||||
name: opening pr for recently new branch search test
|
||||
content: content
|
||||
|
@ -341,9 +341,9 @@
|
|||
|
||||
-
|
||||
id: 21
|
||||
repo_id: 59
|
||||
index: 2
|
||||
poster_id: 39
|
||||
repo_id: 10
|
||||
index: 3
|
||||
poster_id: 12
|
||||
original_author_id: 0
|
||||
name: closed pr for recently new branch search test
|
||||
content: content
|
||||
|
@ -358,9 +358,9 @@
|
|||
|
||||
-
|
||||
id: 22
|
||||
repo_id: 59
|
||||
index: 3
|
||||
poster_id: 39
|
||||
repo_id: 10
|
||||
index: 4
|
||||
poster_id: 12
|
||||
original_author_id: 0
|
||||
name: merged pr for recently new branch search test
|
||||
content: content
|
||||
|
@ -375,9 +375,9 @@
|
|||
|
||||
-
|
||||
id: 23
|
||||
repo_id: 59
|
||||
index: 4
|
||||
poster_id: 39
|
||||
repo_id: 10
|
||||
index: 5
|
||||
poster_id: 12
|
||||
original_author_id: 0
|
||||
name: closed pr with deleted branch for recently new branch search test
|
||||
content: content
|
||||
|
@ -392,9 +392,9 @@
|
|||
|
||||
-
|
||||
id: 24
|
||||
repo_id: 59
|
||||
index: 5
|
||||
poster_id: 39
|
||||
repo_id: 10
|
||||
index: 6
|
||||
poster_id: 12
|
||||
original_author_id: 0
|
||||
name: merged pr with deleted branch for recently new branch search test
|
||||
content: content
|
||||
|
@ -409,9 +409,9 @@
|
|||
|
||||
-
|
||||
id: 25
|
||||
repo_id: 60
|
||||
repo_id: 11
|
||||
index: 1
|
||||
poster_id: 40
|
||||
poster_id: 13
|
||||
original_author_id: 0
|
||||
name: pr with same branch name for recently new branch search test
|
||||
content: content
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
-
|
||||
group_id: 10
|
||||
max_index: 1
|
||||
max_index: 6
|
||||
|
||||
-
|
||||
group_id: 32
|
||||
|
@ -33,11 +33,3 @@
|
|||
-
|
||||
group_id: 51
|
||||
max_index: 1
|
||||
|
||||
-
|
||||
group_id: 58
|
||||
max_index: 5
|
||||
|
||||
-
|
||||
group_id: 59
|
||||
max_index: 1
|
||||
|
|
|
@ -102,7 +102,7 @@
|
|||
|
||||
-
|
||||
id: 18
|
||||
uid: 39
|
||||
uid: 12
|
||||
org_id: 37
|
||||
is_public: false
|
||||
|
||||
|
@ -117,3 +117,15 @@
|
|||
uid: 42
|
||||
org_id: 38
|
||||
is_public: false
|
||||
|
||||
-
|
||||
id: 21
|
||||
uid: 12
|
||||
org_id: 25
|
||||
is_public: true
|
||||
|
||||
-
|
||||
id: 22
|
||||
uid: 2
|
||||
org_id: 35
|
||||
is_public: true
|
||||
|
|
|
@ -95,9 +95,9 @@
|
|||
type: 0 # gitea pull request
|
||||
status: 2 # mergable
|
||||
issue_id: 20
|
||||
index: 1
|
||||
head_repo_id: 59
|
||||
base_repo_id: 59
|
||||
index: 2
|
||||
head_repo_id: 10
|
||||
base_repo_id: 10
|
||||
head_branch: opening-pr
|
||||
base_branch: master
|
||||
merge_base: cb24c347e328d83c1e0c3c908a6b2c0a2fcb8a3d
|
||||
|
@ -108,9 +108,9 @@
|
|||
type: 0 # gitea pull request
|
||||
status: 2 # mergable
|
||||
issue_id: 21
|
||||
index: 2
|
||||
head_repo_id: 59
|
||||
base_repo_id: 59
|
||||
index: 3
|
||||
head_repo_id: 10
|
||||
base_repo_id: 10
|
||||
head_branch: closed-pr
|
||||
base_branch: master
|
||||
merge_base: cb24c347e328d83c1e0c3c908a6b2c0a2fcb8a3d
|
||||
|
@ -121,9 +121,9 @@
|
|||
type: 0 # gitea pull request
|
||||
status: 3 # manually merged
|
||||
issue_id: 22
|
||||
index: 3
|
||||
head_repo_id: 59
|
||||
base_repo_id: 59
|
||||
index: 4
|
||||
head_repo_id: 10
|
||||
base_repo_id: 10
|
||||
head_branch: merged-pr
|
||||
base_branch: master
|
||||
merge_base: cb24c347e328d83c1e0c3c908a6b2c0a2fcb8a3d
|
||||
|
@ -134,9 +134,9 @@
|
|||
type: 0 # gitea pull request
|
||||
status: 2 # mergable
|
||||
issue_id: 23
|
||||
index: 4
|
||||
head_repo_id: 59
|
||||
base_repo_id: 59
|
||||
index: 5
|
||||
head_repo_id: 10
|
||||
base_repo_id: 10
|
||||
head_branch: closed-pr-with-deleted-branch
|
||||
base_branch: master
|
||||
merge_base: cb24c347e328d83c1e0c3c908a6b2c0a2fcb8a3d
|
||||
|
@ -147,9 +147,9 @@
|
|||
type: 0 # gitea pull request
|
||||
status: 3 # manually merged
|
||||
issue_id: 24
|
||||
index: 5
|
||||
head_repo_id: 59
|
||||
base_repo_id: 59
|
||||
index: 6
|
||||
head_repo_id: 10
|
||||
base_repo_id: 10
|
||||
head_branch: merged-pr-with-deleted-branch
|
||||
base_branch: master
|
||||
merge_base: cb24c347e328d83c1e0c3c908a6b2c0a2fcb8a3d
|
||||
|
@ -161,8 +161,8 @@
|
|||
status: 2 # mergable
|
||||
issue_id: 25
|
||||
index: 1
|
||||
head_repo_id: 60
|
||||
base_repo_id: 59
|
||||
head_repo_id: 11
|
||||
base_repo_id: 10
|
||||
head_branch: same-name-branch-in-pr
|
||||
base_branch: master
|
||||
merge_base: cb24c347e328d83c1e0c3c908a6b2c0a2fcb8a3d
|
||||
|
|
|
@ -652,12 +652,12 @@
|
|||
|
||||
-
|
||||
id: 98
|
||||
repo_id: 60
|
||||
repo_id: 59
|
||||
type: 1
|
||||
created_unix: 946684810
|
||||
|
||||
-
|
||||
id: 99
|
||||
repo_id: 61
|
||||
repo_id: 60
|
||||
type: 1
|
||||
created_unix: 946684810
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
fork_id: 0
|
||||
is_template: false
|
||||
template_id: 0
|
||||
size: 7659
|
||||
size: 7320
|
||||
is_fsck_enabled: true
|
||||
close_issues_via_commit_in_any_branch: false
|
||||
|
||||
|
@ -282,11 +282,11 @@
|
|||
default_branch: master
|
||||
num_watches: 0
|
||||
num_stars: 0
|
||||
num_forks: 1
|
||||
num_forks: 3
|
||||
num_issues: 0
|
||||
num_closed_issues: 0
|
||||
num_pulls: 1
|
||||
num_closed_pulls: 0
|
||||
num_pulls: 6
|
||||
num_closed_pulls: 2
|
||||
num_milestones: 1
|
||||
num_closed_milestones: 0
|
||||
num_projects: 0
|
||||
|
@ -316,7 +316,7 @@
|
|||
num_forks: 0
|
||||
num_issues: 0
|
||||
num_closed_issues: 0
|
||||
num_pulls: 0
|
||||
num_pulls: 1
|
||||
num_closed_pulls: 0
|
||||
num_milestones: 0
|
||||
num_closed_milestones: 0
|
||||
|
@ -327,7 +327,7 @@
|
|||
is_archived: false
|
||||
is_mirror: false
|
||||
status: 0
|
||||
is_fork: false
|
||||
is_fork: true
|
||||
fork_id: 10
|
||||
is_template: false
|
||||
template_id: 0
|
||||
|
@ -1696,29 +1696,28 @@
|
|||
|
||||
-
|
||||
id: 59
|
||||
owner_id: 2
|
||||
owner_name: user2
|
||||
lower_name: repo59
|
||||
name: repo59
|
||||
default_branch: master
|
||||
owner_id: 25
|
||||
owner_name: org25
|
||||
lower_name: org_fork_repo59
|
||||
name: org_fork_repo59
|
||||
num_watches: 0
|
||||
num_stars: 0
|
||||
num_forks: 3
|
||||
num_forks: 0
|
||||
num_issues: 0
|
||||
num_closed_issues: 0
|
||||
num_pulls: 5
|
||||
num_closed_pulls: 2
|
||||
num_pulls: 0
|
||||
num_closed_pulls: 0
|
||||
num_milestones: 0
|
||||
num_closed_milestones: 0
|
||||
num_projects: 0
|
||||
num_closed_projects: 0
|
||||
is_private: true
|
||||
is_private: false
|
||||
is_empty: false
|
||||
is_archived: false
|
||||
is_mirror: false
|
||||
status: 0
|
||||
is_fork: false
|
||||
fork_id: 0
|
||||
is_fork: true
|
||||
fork_id: 10
|
||||
is_template: false
|
||||
template_id: 0
|
||||
size: 0
|
||||
|
@ -1727,70 +1726,10 @@
|
|||
|
||||
-
|
||||
id: 60
|
||||
owner_id: 40
|
||||
owner_name: user40
|
||||
lower_name: user_fork_repo60
|
||||
name: user_fork_repo60
|
||||
num_watches: 0
|
||||
num_stars: 0
|
||||
num_forks: 0
|
||||
num_issues: 0
|
||||
num_closed_issues: 0
|
||||
num_pulls: 1
|
||||
num_closed_pulls: 0
|
||||
num_milestones: 0
|
||||
num_closed_milestones: 0
|
||||
num_projects: 0
|
||||
num_closed_projects: 0
|
||||
is_private: false
|
||||
is_empty: false
|
||||
is_archived: false
|
||||
is_mirror: false
|
||||
status: 0
|
||||
is_fork: true
|
||||
fork_id: 59
|
||||
is_template: false
|
||||
template_id: 0
|
||||
size: 0
|
||||
is_fsck_enabled: true
|
||||
close_issues_via_commit_in_any_branch: false
|
||||
|
||||
-
|
||||
id: 61
|
||||
owner_id: 37
|
||||
owner_name: org37
|
||||
lower_name: org_fork_repo61
|
||||
name: org_fork_repo61
|
||||
num_watches: 0
|
||||
num_stars: 0
|
||||
num_forks: 0
|
||||
num_issues: 0
|
||||
num_closed_issues: 0
|
||||
num_pulls: 0
|
||||
num_closed_pulls: 0
|
||||
num_milestones: 0
|
||||
num_closed_milestones: 0
|
||||
num_projects: 0
|
||||
num_closed_projects: 0
|
||||
is_private: false
|
||||
is_empty: false
|
||||
is_archived: false
|
||||
is_mirror: false
|
||||
status: 0
|
||||
is_fork: true
|
||||
fork_id: 59
|
||||
is_template: false
|
||||
template_id: 0
|
||||
size: 0
|
||||
is_fsck_enabled: true
|
||||
close_issues_via_commit_in_any_branch: false
|
||||
|
||||
-
|
||||
id: 62
|
||||
owner_id: 38
|
||||
owner_name: private_org38
|
||||
lower_name: private_org_fork_repo62
|
||||
name: private_org_fork_repo62
|
||||
owner_id: 35
|
||||
owner_name: private_org35
|
||||
lower_name: private_org_fork_repo60
|
||||
name: private_org_fork_repo60
|
||||
num_watches: 0
|
||||
num_stars: 0
|
||||
num_forks: 0
|
||||
|
@ -1808,7 +1747,7 @@
|
|||
is_mirror: false
|
||||
status: 0
|
||||
is_fork: true
|
||||
fork_id: 59
|
||||
fork_id: 10
|
||||
is_template: false
|
||||
template_id: 0
|
||||
size: 0
|
||||
|
|
|
@ -191,7 +191,7 @@
|
|||
lower_name: owners
|
||||
name: Owners
|
||||
authorize: 4 # owner
|
||||
num_repos: 0
|
||||
num_repos: 1
|
||||
num_members: 1
|
||||
includes_all_repositories: false
|
||||
can_create_org_repo: true
|
||||
|
@ -220,10 +220,10 @@
|
|||
|
||||
-
|
||||
id: 21
|
||||
org_id: 37
|
||||
org_id: 25
|
||||
lower_name: owners
|
||||
name: Owners
|
||||
authorize: 4 # owner
|
||||
authorize: 4 # read
|
||||
num_repos: 0
|
||||
num_members: 1
|
||||
includes_all_repositories: false
|
||||
|
@ -231,33 +231,11 @@
|
|||
|
||||
-
|
||||
id: 22
|
||||
org_id: 38
|
||||
lower_name: owners
|
||||
name: Owners
|
||||
authorize: 4 # owner
|
||||
num_repos: 0
|
||||
num_members: 0
|
||||
includes_all_repositories: false
|
||||
can_create_org_repo: true
|
||||
|
||||
-
|
||||
id: 23
|
||||
org_id: 38
|
||||
lower_name: team23readcode
|
||||
name: team23readcode
|
||||
authorize: 1 # read
|
||||
num_repos: 1
|
||||
num_members: 1
|
||||
includes_all_repositories: false
|
||||
can_create_org_repo: true
|
||||
|
||||
-
|
||||
id: 24
|
||||
org_id: 38
|
||||
lower_name: team24noreadcode
|
||||
name: team24noreadcode
|
||||
org_id: 35
|
||||
lower_name: team22noreadcode
|
||||
name: team22noreadcode
|
||||
authorize: 0 # no access
|
||||
num_repos: 1
|
||||
num_members: 1
|
||||
includes_all_repositories: false
|
||||
can_create_org_repo: true
|
||||
can_create_org_repo: false
|
||||
|
|
|
@ -66,12 +66,12 @@
|
|||
|
||||
-
|
||||
id: 12
|
||||
org_id: 38
|
||||
team_id: 23
|
||||
repo_id: 62
|
||||
org_id: 35
|
||||
team_id: 18
|
||||
repo_id: 60
|
||||
|
||||
-
|
||||
id: 13
|
||||
org_id: 38
|
||||
team_id: 24
|
||||
repo_id: 62
|
||||
org_id: 35
|
||||
team_id: 22
|
||||
repo_id: 60
|
||||
|
|
|
@ -289,18 +289,18 @@
|
|||
|
||||
-
|
||||
id: 49
|
||||
team_id: 21
|
||||
team_id: 18
|
||||
type: 1 # code
|
||||
access_mode: 4
|
||||
|
||||
-
|
||||
id: 50
|
||||
team_id: 23
|
||||
team_id: 21
|
||||
type: 1 # code
|
||||
access_mode: 1
|
||||
access_mode: 4
|
||||
|
||||
-
|
||||
id: 51
|
||||
team_id: 24
|
||||
team_id: 22
|
||||
type: 1 # code
|
||||
access_mode: 0
|
||||
|
|
|
@ -126,18 +126,12 @@
|
|||
|
||||
-
|
||||
id: 22
|
||||
org_id: 37
|
||||
org_id: 25
|
||||
team_id: 21
|
||||
uid: 40
|
||||
uid: 12
|
||||
|
||||
-
|
||||
id: 23
|
||||
org_id: 38
|
||||
team_id: 23
|
||||
uid: 41
|
||||
|
||||
-
|
||||
id: 24
|
||||
org_id: 38
|
||||
team_id: 24
|
||||
uid: 42
|
||||
org_id: 35
|
||||
team_id: 22
|
||||
uid: 2
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
num_followers: 2
|
||||
num_following: 1
|
||||
num_stars: 2
|
||||
num_repos: 15
|
||||
num_repos: 14
|
||||
num_teams: 0
|
||||
num_members: 0
|
||||
visibility: 0
|
||||
|
@ -917,9 +917,9 @@
|
|||
num_followers: 0
|
||||
num_following: 0
|
||||
num_stars: 0
|
||||
num_repos: 0
|
||||
num_teams: 1
|
||||
num_members: 1
|
||||
num_repos: 1
|
||||
num_teams: 2
|
||||
num_members: 2
|
||||
visibility: 0
|
||||
repo_admin_change_team_access: false
|
||||
theme: ""
|
||||
|
@ -1288,9 +1288,9 @@
|
|||
num_followers: 0
|
||||
num_following: 0
|
||||
num_stars: 0
|
||||
num_repos: 0
|
||||
num_teams: 1
|
||||
num_members: 1
|
||||
num_repos: 1
|
||||
num_teams: 2
|
||||
num_members: 2
|
||||
visibility: 2
|
||||
repo_admin_change_team_access: false
|
||||
theme: ""
|
||||
|
@ -1332,225 +1332,3 @@
|
|||
repo_admin_change_team_access: false
|
||||
theme: ""
|
||||
keep_activity_private: false
|
||||
|
||||
-
|
||||
id: 37
|
||||
lower_name: org37
|
||||
name: org37
|
||||
full_name: Org 37
|
||||
email: org37@example.com
|
||||
keep_email_private: false
|
||||
email_notifications_preference: enabled
|
||||
passwd: ZogKvWdyEx:password
|
||||
passwd_hash_algo: dummy
|
||||
must_change_password: false
|
||||
login_source: 0
|
||||
login_name: org37
|
||||
type: 1
|
||||
salt: ZogKvWdyEx
|
||||
max_repo_creation: -1
|
||||
is_active: true
|
||||
is_admin: false
|
||||
is_restricted: false
|
||||
allow_git_hook: false
|
||||
allow_import_local: false
|
||||
allow_create_organization: true
|
||||
prohibit_login: false
|
||||
avatar: avatar37
|
||||
avatar_email: org37@example.com
|
||||
use_custom_avatar: false
|
||||
num_followers: 0
|
||||
num_following: 0
|
||||
num_stars: 0
|
||||
num_repos: 1
|
||||
num_teams: 1
|
||||
num_members: 1
|
||||
visibility: 0
|
||||
repo_admin_change_team_access: false
|
||||
theme: ""
|
||||
keep_activity_private: false
|
||||
|
||||
-
|
||||
id: 38
|
||||
lower_name: private_org38
|
||||
name: private_org38
|
||||
full_name: Private Org 38
|
||||
email: private_org38@example.com
|
||||
keep_email_private: false
|
||||
email_notifications_preference: enabled
|
||||
passwd: ZogKvWdyEx:password
|
||||
passwd_hash_algo: dummy
|
||||
must_change_password: false
|
||||
login_source: 0
|
||||
login_name: private_org38
|
||||
type: 1
|
||||
salt: ZogKvWdyEx
|
||||
max_repo_creation: -1
|
||||
is_active: true
|
||||
is_admin: false
|
||||
is_restricted: false
|
||||
allow_git_hook: false
|
||||
allow_import_local: false
|
||||
allow_create_organization: true
|
||||
prohibit_login: false
|
||||
avatar: avatar38
|
||||
avatar_email: private_org38@example.com
|
||||
use_custom_avatar: false
|
||||
num_followers: 0
|
||||
num_following: 0
|
||||
num_stars: 0
|
||||
num_repos: 1
|
||||
num_teams: 3
|
||||
num_members: 2
|
||||
visibility: 2
|
||||
repo_admin_change_team_access: false
|
||||
theme: ""
|
||||
keep_activity_private: false
|
||||
|
||||
-
|
||||
id: 39
|
||||
lower_name: user39
|
||||
name: user39
|
||||
full_name: user39
|
||||
email: user39@example.com
|
||||
keep_email_private: true
|
||||
email_notifications_preference: enabled
|
||||
passwd: ZogKvWdyEx:password
|
||||
passwd_hash_algo: dummy
|
||||
must_change_password: false
|
||||
login_source: 0
|
||||
login_name: user39
|
||||
type: 0
|
||||
salt: ZogKvWdyEx
|
||||
max_repo_creation: -1
|
||||
is_active: true
|
||||
is_admin: false
|
||||
is_restricted: false
|
||||
allow_git_hook: false
|
||||
allow_import_local: false
|
||||
allow_create_organization: true
|
||||
prohibit_login: false
|
||||
avatar: avatar39
|
||||
avatar_email: user39@example.com
|
||||
use_custom_avatar: false
|
||||
num_followers: 0
|
||||
num_following: 0
|
||||
num_stars: 0
|
||||
num_repos: 0
|
||||
num_teams: 0
|
||||
num_members: 0
|
||||
visibility: 0
|
||||
repo_admin_change_team_access: false
|
||||
theme: ""
|
||||
keep_activity_private: false
|
||||
|
||||
-
|
||||
id: 40
|
||||
lower_name: user40
|
||||
name: user40
|
||||
full_name: user40
|
||||
email: user40@example.com
|
||||
keep_email_private: true
|
||||
email_notifications_preference: enabled
|
||||
passwd: ZogKvWdyEx:password
|
||||
passwd_hash_algo: dummy
|
||||
must_change_password: false
|
||||
login_source: 0
|
||||
login_name: user40
|
||||
type: 0
|
||||
salt: ZogKvWdyEx
|
||||
max_repo_creation: -1
|
||||
is_active: true
|
||||
is_admin: false
|
||||
is_restricted: false
|
||||
allow_git_hook: false
|
||||
allow_import_local: false
|
||||
allow_create_organization: true
|
||||
prohibit_login: false
|
||||
avatar: avatar40
|
||||
avatar_email: user40@example.com
|
||||
use_custom_avatar: false
|
||||
num_followers: 0
|
||||
num_following: 0
|
||||
num_stars: 0
|
||||
num_repos: 1
|
||||
num_teams: 0
|
||||
num_members: 0
|
||||
visibility: 0
|
||||
repo_admin_change_team_access: false
|
||||
theme: ""
|
||||
keep_activity_private: false
|
||||
|
||||
-
|
||||
id: 41
|
||||
lower_name: user41
|
||||
name: user41
|
||||
full_name: user41
|
||||
email: user41@example.com
|
||||
keep_email_private: true
|
||||
email_notifications_preference: enabled
|
||||
passwd: ZogKvWdyEx:password
|
||||
passwd_hash_algo: dummy
|
||||
must_change_password: false
|
||||
login_source: 0
|
||||
login_name: user41
|
||||
type: 0
|
||||
salt: ZogKvWdyEx
|
||||
max_repo_creation: -1
|
||||
is_active: true
|
||||
is_admin: false
|
||||
is_restricted: false
|
||||
allow_git_hook: false
|
||||
allow_import_local: false
|
||||
allow_create_organization: true
|
||||
prohibit_login: false
|
||||
avatar: avatar41
|
||||
avatar_email: user41@example.com
|
||||
use_custom_avatar: false
|
||||
num_followers: 0
|
||||
num_following: 0
|
||||
num_stars: 0
|
||||
num_repos: 0
|
||||
num_teams: 0
|
||||
num_members: 0
|
||||
visibility: 0
|
||||
repo_admin_change_team_access: false
|
||||
theme: ""
|
||||
keep_activity_private: false
|
||||
|
||||
-
|
||||
id: 42
|
||||
lower_name: user42
|
||||
name: user42
|
||||
full_name: user42
|
||||
email: user42@example.com
|
||||
keep_email_private: true
|
||||
email_notifications_preference: enabled
|
||||
passwd: ZogKvWdyEx:password
|
||||
passwd_hash_algo: dummy
|
||||
must_change_password: false
|
||||
login_source: 0
|
||||
login_name: user42
|
||||
type: 0
|
||||
salt: ZogKvWdyEx
|
||||
max_repo_creation: -1
|
||||
is_active: true
|
||||
is_admin: false
|
||||
is_restricted: false
|
||||
allow_git_hook: false
|
||||
allow_import_local: false
|
||||
allow_create_organization: true
|
||||
prohibit_login: false
|
||||
avatar: avatar42
|
||||
avatar_email: user42@example.com
|
||||
use_custom_avatar: false
|
||||
num_followers: 0
|
||||
num_following: 0
|
||||
num_stars: 0
|
||||
num_repos: 0
|
||||
num_teams: 0
|
||||
num_members: 0
|
||||
visibility: 0
|
||||
repo_admin_change_team_access: false
|
||||
theme: ""
|
||||
keep_activity_private: false
|
||||
|
|
|
@ -188,11 +188,11 @@ func TestOnlyGetDeletedBranchOnCorrectRepo(t *testing.T) {
|
|||
func TestFindRecentlyPushedNewBranches(t *testing.T) {
|
||||
assert.NoError(t, unittest.PrepareTestDatabase())
|
||||
|
||||
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 59})
|
||||
user39 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 39})
|
||||
user40 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 40})
|
||||
user41 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 41})
|
||||
user42 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 42})
|
||||
repo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 10})
|
||||
user1 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 1})
|
||||
user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2})
|
||||
user12 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 12})
|
||||
user13 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 13})
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
|
@ -200,12 +200,12 @@ func TestFindRecentlyPushedNewBranches(t *testing.T) {
|
|||
count int
|
||||
want []string
|
||||
}{
|
||||
// user39 is the owner of the repo and the organization
|
||||
// in repo58, user39 has opening/closed/merged pr and closed/merged pr with deleted branch
|
||||
// user12 is the owner of the repo10 and the organization org25
|
||||
// in repo10, user12 has opening/closed/merged pr and closed/merged pr with deleted branch
|
||||
{
|
||||
name: "new branch of the repo, org fork repo, pr branches and deleted branch",
|
||||
opts: &git_model.FindRecentlyPushedNewBranchesOptions{
|
||||
Actor: user39,
|
||||
Actor: user12,
|
||||
CommitAfterUnix: 1489927670,
|
||||
ListOptions: db.ListOptions{
|
||||
PageSize: 10,
|
||||
|
@ -213,15 +213,15 @@ func TestFindRecentlyPushedNewBranches(t *testing.T) {
|
|||
},
|
||||
},
|
||||
count: 2,
|
||||
want: []string{"new-commit", "org37/org_fork_repo61:org-fork-new-commit"},
|
||||
want: []string{"new-commit", "org25/org_fork_repo59:org-fork-new-commit"},
|
||||
},
|
||||
// we have 2 branches with the same name in repo59 and repo60
|
||||
// and repo60's branch has a pr, but repo59's branch doesn't
|
||||
// in this case, we should get repo59's branch but not repo60's branch
|
||||
// user13 pushed 2 branches with the same name in repo10 and repo11
|
||||
// and repo11's branch has a pr, but repo10's branch doesn't
|
||||
// in this case, we should get repo10's branch but not repo11's branch
|
||||
{
|
||||
name: "new branch from user fork repo and same name branch",
|
||||
opts: &git_model.FindRecentlyPushedNewBranchesOptions{
|
||||
Actor: user40,
|
||||
Actor: user13,
|
||||
CommitAfterUnix: 1489927670,
|
||||
ListOptions: db.ListOptions{
|
||||
PageSize: 10,
|
||||
|
@ -229,21 +229,23 @@ func TestFindRecentlyPushedNewBranches(t *testing.T) {
|
|||
},
|
||||
},
|
||||
count: 2,
|
||||
want: []string{"user40/user_fork_repo60:user-fork-new-commit", "same-name-branch-in-pr"},
|
||||
want: []string{"user13/repo11:user-fork-new-commit", "same-name-branch-in-pr"},
|
||||
},
|
||||
// user1 is the owner of private_org35
|
||||
{
|
||||
name: "new branch from private org with code permisstion repo",
|
||||
name: "new branch from private org with code permission repo",
|
||||
opts: &git_model.FindRecentlyPushedNewBranchesOptions{
|
||||
Actor: user41,
|
||||
Actor: user1,
|
||||
CommitAfterUnix: 1489927670,
|
||||
},
|
||||
count: 1,
|
||||
want: []string{"private_org38/private_org_fork_repo62:private-org-fork-new-commit"},
|
||||
want: []string{"private_org35/private_org_fork_repo60:private-org-fork-new-commit"},
|
||||
},
|
||||
// user2 does not have code permission in private_org35
|
||||
{
|
||||
name: "new branch from private org with no code permisstion repo",
|
||||
name: "new branch from private org with no code permission repo",
|
||||
opts: &git_model.FindRecentlyPushedNewBranchesOptions{
|
||||
Actor: user42,
|
||||
Actor: user2,
|
||||
CommitAfterUnix: 1489927670,
|
||||
},
|
||||
count: 0,
|
||||
|
@ -252,11 +254,11 @@ func TestFindRecentlyPushedNewBranches(t *testing.T) {
|
|||
{
|
||||
name: "test commitAfterUnix option",
|
||||
opts: &git_model.FindRecentlyPushedNewBranchesOptions{
|
||||
Actor: user39,
|
||||
Actor: user12,
|
||||
CommitAfterUnix: 1489927690,
|
||||
},
|
||||
count: 1,
|
||||
want: []string{"org37/org_fork_repo61:org-fork-new-commit"},
|
||||
want: []string{"org25/org_fork_repo59:org-fork-new-commit"},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ func TestUserListIsPublicMember(t *testing.T) {
|
|||
{3, map[int64]bool{2: true, 4: false, 28: true}},
|
||||
{6, map[int64]bool{5: true, 28: true}},
|
||||
{7, map[int64]bool{5: false}},
|
||||
{25, map[int64]bool{24: true}},
|
||||
{25, map[int64]bool{12: true, 24: true}},
|
||||
{22, map[int64]bool{}},
|
||||
}
|
||||
for _, v := range tt {
|
||||
|
@ -108,8 +108,8 @@ func TestUserListIsUserOrgOwner(t *testing.T) {
|
|||
{3, map[int64]bool{2: true, 4: false, 28: false}},
|
||||
{6, map[int64]bool{5: true, 28: false}},
|
||||
{7, map[int64]bool{5: true}},
|
||||
{25, map[int64]bool{24: false}}, // ErrTeamNotExist
|
||||
{22, map[int64]bool{}}, // No member
|
||||
{25, map[int64]bool{12: true, 24: false}}, // ErrTeamNotExist
|
||||
{22, map[int64]bool{}}, // No member
|
||||
}
|
||||
for _, v := range tt {
|
||||
t.Run(fmt.Sprintf("IsUserOrgOwnerOfOrgId%d", v.orgid), func(t *testing.T) {
|
||||
|
|
|
@ -138,12 +138,12 @@ func getTestCases() []struct {
|
|||
{
|
||||
name: "AllPublic/PublicRepositoriesOfUserIncludingCollaborative",
|
||||
opts: &repo_model.SearchRepoOptions{ListOptions: db.ListOptions{Page: 1, PageSize: 10}, OwnerID: 15, AllPublic: true, Template: util.OptionalBoolFalse},
|
||||
count: 33,
|
||||
count: 32,
|
||||
},
|
||||
{
|
||||
name: "AllPublic/PublicAndPrivateRepositoriesOfUserIncludingCollaborative",
|
||||
opts: &repo_model.SearchRepoOptions{ListOptions: db.ListOptions{Page: 1, PageSize: 10}, OwnerID: 15, Private: true, AllPublic: true, AllLimited: true, Template: util.OptionalBoolFalse},
|
||||
count: 38,
|
||||
count: 37,
|
||||
},
|
||||
{
|
||||
name: "AllPublic/PublicAndPrivateRepositoriesOfUserIncludingCollaborativeByName",
|
||||
|
@ -158,7 +158,7 @@ func getTestCases() []struct {
|
|||
{
|
||||
name: "AllPublic/PublicRepositoriesOfOrganization",
|
||||
opts: &repo_model.SearchRepoOptions{ListOptions: db.ListOptions{Page: 1, PageSize: 10}, OwnerID: 17, AllPublic: true, Collaborate: util.OptionalBoolFalse, Template: util.OptionalBoolFalse},
|
||||
count: 33,
|
||||
count: 32,
|
||||
},
|
||||
{
|
||||
name: "AllTemplates",
|
||||
|
|
|
@ -89,7 +89,7 @@ func TestSearchUsers(t *testing.T) {
|
|||
[]int64{19, 25})
|
||||
|
||||
testOrgSuccess(&user_model.SearchUserOptions{OrderBy: "id ASC", ListOptions: db.ListOptions{Page: 4, PageSize: 2}},
|
||||
[]int64{26, 37})
|
||||
[]int64{26})
|
||||
|
||||
testOrgSuccess(&user_model.SearchUserOptions{ListOptions: db.ListOptions{Page: 5, PageSize: 2}},
|
||||
[]int64{})
|
||||
|
@ -101,13 +101,13 @@ func TestSearchUsers(t *testing.T) {
|
|||
}
|
||||
|
||||
testUserSuccess(&user_model.SearchUserOptions{OrderBy: "id ASC", ListOptions: db.ListOptions{Page: 1}},
|
||||
[]int64{1, 2, 4, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 20, 21, 24, 27, 28, 29, 30, 32, 34, 39, 40, 41, 42})
|
||||
[]int64{1, 2, 4, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 20, 21, 24, 27, 28, 29, 30, 32, 34})
|
||||
|
||||
testUserSuccess(&user_model.SearchUserOptions{ListOptions: db.ListOptions{Page: 1}, IsActive: util.OptionalBoolFalse},
|
||||
[]int64{9})
|
||||
|
||||
testUserSuccess(&user_model.SearchUserOptions{OrderBy: "id ASC", ListOptions: db.ListOptions{Page: 1}, IsActive: util.OptionalBoolTrue},
|
||||
[]int64{1, 2, 4, 5, 8, 10, 11, 12, 13, 14, 15, 16, 18, 20, 21, 24, 27, 28, 29, 30, 32, 34, 39, 40, 41, 42})
|
||||
[]int64{1, 2, 4, 5, 8, 10, 11, 12, 13, 14, 15, 16, 18, 20, 21, 24, 27, 28, 29, 30, 32, 34})
|
||||
|
||||
testUserSuccess(&user_model.SearchUserOptions{Keyword: "user1", OrderBy: "id ASC", ListOptions: db.ListOptions{Page: 1}, IsActive: util.OptionalBoolTrue},
|
||||
[]int64{1, 10, 11, 12, 13, 14, 15, 16, 18})
|
||||
|
|
|
@ -75,7 +75,7 @@ func TestPulls(t *testing.T) {
|
|||
Pulls(ctx)
|
||||
assert.EqualValues(t, http.StatusOK, ctx.Resp.Status())
|
||||
|
||||
assert.Len(t, ctx.Data["Issues"], 8)
|
||||
assert.Len(t, ctx.Data["Issues"], 5)
|
||||
}
|
||||
|
||||
func TestMilestones(t *testing.T) {
|
||||
|
|
|
@ -296,7 +296,7 @@ func TestAPISearchIssues(t *testing.T) {
|
|||
req = NewRequest(t, "GET", link.String())
|
||||
resp = MakeRequest(t, req, http.StatusOK)
|
||||
DecodeJSON(t, resp, &apiIssues)
|
||||
assert.Len(t, apiIssues, 11)
|
||||
assert.Len(t, apiIssues, 8)
|
||||
|
||||
query = url.Values{"owner": {"user3"}, "token": {token}} // organization
|
||||
link.RawQuery = query.Encode()
|
||||
|
@ -317,7 +317,7 @@ func TestAPISearchIssuesWithLabels(t *testing.T) {
|
|||
defer tests.PrepareTestEnv(t)()
|
||||
|
||||
// as this API was used in the frontend, it uses UI page size
|
||||
expectedIssueCount := 22 // from the fixtures
|
||||
expectedIssueCount := 21 // from the fixtures
|
||||
if expectedIssueCount > setting.UI.IssuePagingNum {
|
||||
expectedIssueCount = setting.UI.IssuePagingNum
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ func TestNodeinfo(t *testing.T) {
|
|||
DecodeJSON(t, resp, &nodeinfo)
|
||||
assert.True(t, nodeinfo.OpenRegistrations)
|
||||
assert.Equal(t, "gitea", nodeinfo.Software.Name)
|
||||
assert.Equal(t, 29, nodeinfo.Usage.Users.Total)
|
||||
assert.Equal(t, 25, nodeinfo.Usage.Users.Total)
|
||||
assert.Equal(t, 25, nodeinfo.Usage.LocalPosts)
|
||||
assert.Equal(t, 2, nodeinfo.Usage.LocalComments)
|
||||
})
|
||||
|
|
|
@ -170,7 +170,7 @@ func TestAPIGetAll(t *testing.T) {
|
|||
var apiOrgList []*api.Organization
|
||||
|
||||
DecodeJSON(t, resp, &apiOrgList)
|
||||
assert.Len(t, apiOrgList, 13)
|
||||
assert.Len(t, apiOrgList, 11)
|
||||
assert.Equal(t, "Limited Org 36", apiOrgList[1].FullName)
|
||||
assert.Equal(t, "limited", apiOrgList[1].Visibility)
|
||||
|
||||
|
@ -179,7 +179,7 @@ func TestAPIGetAll(t *testing.T) {
|
|||
resp = MakeRequest(t, req, http.StatusOK)
|
||||
|
||||
DecodeJSON(t, resp, &apiOrgList)
|
||||
assert.Len(t, apiOrgList, 8)
|
||||
assert.Len(t, apiOrgList, 7)
|
||||
assert.Equal(t, "org25", apiOrgList[0].FullName)
|
||||
assert.Equal(t, "public", apiOrgList[0].Visibility)
|
||||
}
|
||||
|
|
|
@ -93,9 +93,9 @@ func TestAPISearchRepo(t *testing.T) {
|
|||
}{
|
||||
{
|
||||
name: "RepositoriesMax50", requestURL: "/api/v1/repos/search?limit=50&private=false", expectedResults: expectedResults{
|
||||
nil: {count: 35},
|
||||
user: {count: 35},
|
||||
user2: {count: 35},
|
||||
nil: {count: 34},
|
||||
user: {count: 34},
|
||||
user2: {count: 34},
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -274,8 +274,8 @@ func TestAPIViewRepo(t *testing.T) {
|
|||
DecodeJSON(t, resp, &repo)
|
||||
assert.EqualValues(t, 10, repo.ID)
|
||||
assert.EqualValues(t, "repo10", repo.Name)
|
||||
assert.EqualValues(t, 1, repo.OpenPulls)
|
||||
assert.EqualValues(t, 1, repo.Forks)
|
||||
assert.EqualValues(t, 4, repo.OpenPulls)
|
||||
assert.EqualValues(t, 3, repo.Forks)
|
||||
|
||||
req = NewRequest(t, "GET", "/api/v1/repos/user5/repo4")
|
||||
resp = MakeRequest(t, req, http.StatusOK)
|
||||
|
|
|
@ -29,8 +29,21 @@ func TestUserOrgs(t *testing.T) {
|
|||
|
||||
user3 := unittest.AssertExistsAndLoadBean(t, &user_model.User{Name: "user3"})
|
||||
user17 := unittest.AssertExistsAndLoadBean(t, &user_model.User{Name: "user17"})
|
||||
user35 := unittest.AssertExistsAndLoadBean(t, &user_model.User{Name: "private_org35"})
|
||||
|
||||
assert.Equal(t, []*api.Organization{
|
||||
{
|
||||
ID: 35,
|
||||
Name: user35.Name,
|
||||
UserName: user35.Name,
|
||||
FullName: user35.FullName,
|
||||
Email: user35.Email,
|
||||
AvatarURL: user35.AvatarLink(db.DefaultContext),
|
||||
Description: "",
|
||||
Website: "",
|
||||
Location: "",
|
||||
Visibility: "private",
|
||||
},
|
||||
{
|
||||
ID: 17,
|
||||
Name: user17.Name,
|
||||
|
@ -101,8 +114,21 @@ func TestMyOrgs(t *testing.T) {
|
|||
DecodeJSON(t, resp, &orgs)
|
||||
user3 := unittest.AssertExistsAndLoadBean(t, &user_model.User{Name: "user3"})
|
||||
user17 := unittest.AssertExistsAndLoadBean(t, &user_model.User{Name: "user17"})
|
||||
user35 := unittest.AssertExistsAndLoadBean(t, &user_model.User{Name: "private_org35"})
|
||||
|
||||
assert.Equal(t, []*api.Organization{
|
||||
{
|
||||
ID: 35,
|
||||
Name: user35.Name,
|
||||
UserName: user35.Name,
|
||||
FullName: user35.FullName,
|
||||
Email: user35.Email,
|
||||
AvatarURL: user35.AvatarLink(db.DefaultContext),
|
||||
Description: "",
|
||||
Website: "",
|
||||
Location: "",
|
||||
Visibility: "private",
|
||||
},
|
||||
{
|
||||
ID: 17,
|
||||
Name: user17.Name,
|
||||
|
|
|
@ -430,7 +430,7 @@ func TestSearchIssues(t *testing.T) {
|
|||
req = NewRequest(t, "GET", link.String())
|
||||
resp = session.MakeRequest(t, req, http.StatusOK)
|
||||
DecodeJSON(t, resp, &apiIssues)
|
||||
assert.Len(t, apiIssues, 11)
|
||||
assert.Len(t, apiIssues, 8)
|
||||
|
||||
query = url.Values{"owner": {"user3"}} // organization
|
||||
link.RawQuery = query.Encode()
|
||||
|
|
Loading…
Reference in New Issue