mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 02:46:04 +01: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:
		| @@ -64,11 +64,9 @@ func TestGetUserHeatmapDataByUser(t *testing.T) { | ||||
| 	for _, tc := range testCases { | ||||
| 		user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: tc.userID}) | ||||
|  | ||||
| 		doer := &user_model.User{ID: tc.doerID} | ||||
| 		_, err := unittest.LoadBeanIfExists(doer) | ||||
| 		assert.NoError(t, err) | ||||
| 		if tc.doerID == 0 { | ||||
| 			doer = nil | ||||
| 		var doer *user_model.User | ||||
| 		if tc.doerID != 0 { | ||||
| 			doer = unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: tc.doerID}) | ||||
| 		} | ||||
|  | ||||
| 		// get the action for comparison | ||||
|   | ||||
		Reference in New Issue
	
	Block a user