1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Replace 'userxx' with 'orgxx' in all test files when the user type is org (#27052)

Currently 'userxx' and 'orgxx' are both used as username in test files
when the user type is org, which is confusing. This PR replaces all
'userxx' with 'orgxx' when the user type is org(`user.type==1`).
Some non-trivial changes
1. Rename `user3` dir to `org3` in `tests/git-repositories-meta` 
2. Change `end` in `issue reference` because 'org3' is one char shorter
than 'user3'

![ksnip_20230913-112819](https://github.com/go-gitea/gitea/assets/70063547/442988c5-4cf4-49b8-aa01-4dd6bf0ca954)
3. Change the search result number of `user/repo2` because
`user3/repo21` can't be searched now

![ksnip_20230913-112931](https://github.com/go-gitea/gitea/assets/70063547/d9ebeba4-479f-4110-9a85-825efbc981fd)
4. Change the first org name getting from API because the result is
ordered by alphabet asc and now `org 17` is before `org25`
![JW8U7NIO(J$H
_YCRB36H)T](https://github.com/go-gitea/gitea/assets/70063547/f55a685c-cf24-40e5-a87f-3a2327319548)
![)KFD411O4I8RB5ZOH7E0
Z3](https://github.com/go-gitea/gitea/assets/70063547/a0dc3299-249c-46f6-91cb-d15d4ee88dd5)

Other modifications are just find all and replace all.
Unit tests with SQLite are all passed.

---------

Co-authored-by: caicandong <1290147055@qq.com>
This commit is contained in:
Nanguan Lin
2023-09-14 10:59:53 +08:00
committed by GitHub
parent d0318c4ae0
commit da50be7360
91 changed files with 280 additions and 280 deletions

View File

@@ -73,8 +73,8 @@
-
id: 10
uid: 3
email: user3@example.com
lower_email: user3@example.com
email: org3@example.com
lower_email: org3@example.com
is_activated: true
is_primary: true
@@ -97,16 +97,16 @@
-
id: 13
uid: 6
email: user6@example.com
lower_email: user6@example.com
email: org6@example.com
lower_email: org6@example.com
is_activated: true
is_primary: true
-
id: 14
uid: 7
email: user7@example.com
lower_email: user7@example.com
email: org7@example.com
lower_email: org7@example.com
is_activated: true
is_primary: true
@@ -153,8 +153,8 @@
-
id: 20
uid: 17
email: user17@example.com
lower_email: user17@example.com
email: org17@example.com
lower_email: org17@example.com
is_activated: true
is_primary: true
@@ -169,8 +169,8 @@
-
id: 22
uid: 19
email: user19@example.com
lower_email: user19@example.com
email: org19@example.com
lower_email: org19@example.com
is_activated: true
is_primary: true

View File

@@ -64,7 +64,7 @@
-
id: 3
owner_id: 3
owner_name: user3
owner_name: org3
lower_name: repo3
name: repo3
default_branch: master
@@ -126,7 +126,7 @@
-
id: 5
owner_id: 3
owner_name: user3
owner_name: org3
lower_name: repo5
name: repo5
num_watches: 0
@@ -671,7 +671,7 @@
-
id: 23
owner_id: 17
owner_name: user17
owner_name: org17
lower_name: big_test_public_4
name: big_test_public_4
num_watches: 0
@@ -701,7 +701,7 @@
-
id: 24
owner_id: 17
owner_name: user17
owner_name: org17
lower_name: big_test_private_4
name: big_test_private_4
num_watches: 0
@@ -791,7 +791,7 @@
-
id: 27
owner_id: 19
owner_name: user19
owner_name: org19
lower_name: big_test_public_mirror_6
name: big_test_public_mirror_6
num_watches: 0
@@ -821,7 +821,7 @@
-
id: 28
owner_id: 19
owner_name: user19
owner_name: org19
lower_name: big_test_private_mirror_6
name: big_test_private_mirror_6
num_watches: 0
@@ -942,7 +942,7 @@
-
id: 32 # org public repo
owner_id: 3
owner_name: user3
owner_name: org3
lower_name: repo21
name: repo21
num_watches: 0

View File

@@ -129,6 +129,6 @@
type: 1
reviewer_id: 6
issue_id: 11
content: "singular review from user6 and final review for this pr"
content: "singular review from org6 and final review for this pr"
updated_unix: 946684831
created_unix: 946684831

View File

@@ -76,17 +76,17 @@
-
id: 3
lower_name: user3
name: user3
lower_name: org3
name: org3
full_name: ' <<<< >> >> > >> > >>> >> '
email: user3@example.com
email: org3@example.com
keep_email_private: false
email_notifications_preference: onmention
passwd: ZogKvWdyEx:password
passwd_hash_algo: dummy
must_change_password: false
login_source: 0
login_name: user3
login_name: org3
type: 1
salt: ZogKvWdyEx
max_repo_creation: -1
@@ -98,7 +98,7 @@
allow_create_organization: true
prohibit_login: false
avatar: avatar3
avatar_email: user3@example.com
avatar_email: org3@example.com
use_custom_avatar: false
num_followers: 0
num_following: 0
@@ -187,17 +187,17 @@
-
id: 6
lower_name: user6
name: user6
full_name: User Six
email: user6@example.com
lower_name: org6
name: org6
full_name: Org Six
email: org6@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: user6
login_name: org6
type: 1
salt: ZogKvWdyEx
max_repo_creation: -1
@@ -209,7 +209,7 @@
allow_create_organization: true
prohibit_login: false
avatar: avatar6
avatar_email: user6@example.com
avatar_email: org6@example.com
use_custom_avatar: false
num_followers: 0
num_following: 0
@@ -224,17 +224,17 @@
-
id: 7
lower_name: user7
name: user7
full_name: User Seven
email: user7@example.com
lower_name: org7
name: org7
full_name: Org Seven
email: org7@example.com
keep_email_private: false
email_notifications_preference: disabled
passwd: ZogKvWdyEx:password
passwd_hash_algo: dummy
must_change_password: false
login_source: 0
login_name: user7
login_name: org7
type: 1
salt: ZogKvWdyEx
max_repo_creation: -1
@@ -246,7 +246,7 @@
allow_create_organization: true
prohibit_login: false
avatar: avatar7
avatar_email: user7@example.com
avatar_email: org7@example.com
use_custom_avatar: false
num_followers: 0
num_following: 0
@@ -594,17 +594,17 @@
-
id: 17
lower_name: user17
name: user17
full_name: User 17
email: user17@example.com
lower_name: org17
name: org17
full_name: org 17
email: org17@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: user17
login_name: org17
type: 1
salt: ZogKvWdyEx
max_repo_creation: -1
@@ -616,7 +616,7 @@
allow_create_organization: true
prohibit_login: false
avatar: avatar17
avatar_email: user17@example.com
avatar_email: org17@example.com
use_custom_avatar: false
num_followers: 0
num_following: 0
@@ -668,17 +668,17 @@
-
id: 19
lower_name: user19
name: user19
full_name: User 19
email: user19@example.com
lower_name: org19
name: org19
full_name: Org 19
email: org19@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: user19
login_name: org19
type: 1
salt: ZogKvWdyEx
max_repo_creation: -1
@@ -690,7 +690,7 @@
allow_create_organization: true
prohibit_login: false
avatar: avatar19
avatar_email: user19@example.com
avatar_email: org19@example.com
use_custom_avatar: false
num_followers: 0
num_following: 0