mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-26 12:27:06 +00:00 
			
		
		
		
	Penultimate round of db.DefaultContext refactor (#27414)
				
					
				
			Part of #27065 --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
		| @@ -210,15 +210,15 @@ func TestAddLdapBindDn(t *testing.T) { | ||||
| 			initDB: func(context.Context) error { | ||||
| 				return nil | ||||
| 			}, | ||||
| 			createAuthSource: func(authSource *auth.Source) error { | ||||
| 			createAuthSource: func(ctx context.Context, authSource *auth.Source) error { | ||||
| 				createdAuthSource = authSource | ||||
| 				return nil | ||||
| 			}, | ||||
| 			updateAuthSource: func(authSource *auth.Source) error { | ||||
| 			updateAuthSource: func(ctx context.Context, authSource *auth.Source) error { | ||||
| 				assert.FailNow(t, "case %d: should not call updateAuthSource", n) | ||||
| 				return nil | ||||
| 			}, | ||||
| 			getAuthSourceByID: func(id int64) (*auth.Source, error) { | ||||
| 			getAuthSourceByID: func(ctx context.Context, id int64) (*auth.Source, error) { | ||||
| 				assert.FailNow(t, "case %d: should not call getAuthSourceByID", n) | ||||
| 				return nil, nil | ||||
| 			}, | ||||
| @@ -441,15 +441,15 @@ func TestAddLdapSimpleAuth(t *testing.T) { | ||||
| 			initDB: func(context.Context) error { | ||||
| 				return nil | ||||
| 			}, | ||||
| 			createAuthSource: func(authSource *auth.Source) error { | ||||
| 			createAuthSource: func(ctx context.Context, authSource *auth.Source) error { | ||||
| 				createdAuthSource = authSource | ||||
| 				return nil | ||||
| 			}, | ||||
| 			updateAuthSource: func(authSource *auth.Source) error { | ||||
| 			updateAuthSource: func(ctx context.Context, authSource *auth.Source) error { | ||||
| 				assert.FailNow(t, "case %d: should not call updateAuthSource", n) | ||||
| 				return nil | ||||
| 			}, | ||||
| 			getAuthSourceByID: func(id int64) (*auth.Source, error) { | ||||
| 			getAuthSourceByID: func(ctx context.Context, id int64) (*auth.Source, error) { | ||||
| 				assert.FailNow(t, "case %d: should not call getAuthSourceByID", n) | ||||
| 				return nil, nil | ||||
| 			}, | ||||
| @@ -896,15 +896,15 @@ func TestUpdateLdapBindDn(t *testing.T) { | ||||
| 			initDB: func(context.Context) error { | ||||
| 				return nil | ||||
| 			}, | ||||
| 			createAuthSource: func(authSource *auth.Source) error { | ||||
| 			createAuthSource: func(ctx context.Context, authSource *auth.Source) error { | ||||
| 				assert.FailNow(t, "case %d: should not call createAuthSource", n) | ||||
| 				return nil | ||||
| 			}, | ||||
| 			updateAuthSource: func(authSource *auth.Source) error { | ||||
| 			updateAuthSource: func(ctx context.Context, authSource *auth.Source) error { | ||||
| 				updatedAuthSource = authSource | ||||
| 				return nil | ||||
| 			}, | ||||
| 			getAuthSourceByID: func(id int64) (*auth.Source, error) { | ||||
| 			getAuthSourceByID: func(ctx context.Context, id int64) (*auth.Source, error) { | ||||
| 				if c.id != 0 { | ||||
| 					assert.Equal(t, c.id, id, "case %d: wrong id", n) | ||||
| 				} | ||||
| @@ -1286,15 +1286,15 @@ func TestUpdateLdapSimpleAuth(t *testing.T) { | ||||
| 			initDB: func(context.Context) error { | ||||
| 				return nil | ||||
| 			}, | ||||
| 			createAuthSource: func(authSource *auth.Source) error { | ||||
| 			createAuthSource: func(ctx context.Context, authSource *auth.Source) error { | ||||
| 				assert.FailNow(t, "case %d: should not call createAuthSource", n) | ||||
| 				return nil | ||||
| 			}, | ||||
| 			updateAuthSource: func(authSource *auth.Source) error { | ||||
| 			updateAuthSource: func(ctx context.Context, authSource *auth.Source) error { | ||||
| 				updatedAuthSource = authSource | ||||
| 				return nil | ||||
| 			}, | ||||
| 			getAuthSourceByID: func(id int64) (*auth.Source, error) { | ||||
| 			getAuthSourceByID: func(ctx context.Context, id int64) (*auth.Source, error) { | ||||
| 				if c.id != 0 { | ||||
| 					assert.Equal(t, c.id, id, "case %d: wrong id", n) | ||||
| 				} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 JakobDev
					JakobDev