mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-29 10:57:44 +09:00 
			
		
		
		
	Refactor tests (#33021)
1. fix incorrect tests, for example: BeanExists doesn't do assert and shouldn't be used 2. remove unnecessary test functions 3. introduce DumpQueryResult to help to see the database rows during test (at least I need it) ``` ====== DumpQueryResult: SELECT * FROM action_runner_token ====== - # row[0] id: 1 token: xeiWBL5kuTYxGPynHCqQdoeYmJAeG3IzGXCYTrDX owner_id: 0 ... ```
This commit is contained in:
		| @@ -47,7 +47,7 @@ func TestRemoveOrgUser(t *testing.T) { | ||||
|  | ||||
| 	testSuccess := func(org *organization.Organization, user *user_model.User) { | ||||
| 		expectedNumMembers := org.NumMembers | ||||
| 		if unittest.BeanExists(t, &organization.OrgUser{OrgID: org.ID, UID: user.ID}) { | ||||
| 		if unittest.GetBean(t, &organization.OrgUser{OrgID: org.ID, UID: user.ID}) != nil { | ||||
| 			expectedNumMembers-- | ||||
| 		} | ||||
| 		assert.NoError(t, RemoveOrgUser(db.DefaultContext, org, user)) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user