@@ -88,7 +88,7 @@ func TestCanCreateOrganization(t *testing.T) {
8888
8989func  TestSearchUsers (t  * testing.T ) {
9090	assert .NoError (t , unittest .PrepareTestDatabase ())
91- 	testSuccess  :=  func (opts  * user_model.SearchUserOptions , expectedUserOrOrgIDs  []int64 ) {
91+ 	testSuccess  :=  func (opts  user_model.SearchUserOptions , expectedUserOrOrgIDs  []int64 ) {
9292		users , _ , err  :=  user_model .SearchUsers (db .DefaultContext , opts )
9393		assert .NoError (t , err )
9494		cassText  :=  fmt .Sprintf ("ids: %v, opts: %v" , expectedUserOrOrgIDs , opts )
@@ -100,61 +100,61 @@ func TestSearchUsers(t *testing.T) {
100100	}
101101
102102	// test orgs 
103- 	testOrgSuccess  :=  func (opts  * user_model.SearchUserOptions , expectedOrgIDs  []int64 ) {
103+ 	testOrgSuccess  :=  func (opts  user_model.SearchUserOptions , expectedOrgIDs  []int64 ) {
104104		opts .Type  =  user_model .UserTypeOrganization 
105105		testSuccess (opts , expectedOrgIDs )
106106	}
107107
108- 	testOrgSuccess (& user_model.SearchUserOptions {OrderBy : "id ASC" , ListOptions : db.ListOptions {Page : 1 , PageSize : 2 }},
108+ 	testOrgSuccess (user_model.SearchUserOptions {OrderBy : "id ASC" , ListOptions : db.ListOptions {Page : 1 , PageSize : 2 }},
109109		[]int64 {3 , 6 })
110110
111- 	testOrgSuccess (& user_model.SearchUserOptions {OrderBy : "id ASC" , ListOptions : db.ListOptions {Page : 2 , PageSize : 2 }},
111+ 	testOrgSuccess (user_model.SearchUserOptions {OrderBy : "id ASC" , ListOptions : db.ListOptions {Page : 2 , PageSize : 2 }},
112112		[]int64 {7 , 17 })
113113
114- 	testOrgSuccess (& user_model.SearchUserOptions {OrderBy : "id ASC" , ListOptions : db.ListOptions {Page : 3 , PageSize : 2 }},
114+ 	testOrgSuccess (user_model.SearchUserOptions {OrderBy : "id ASC" , ListOptions : db.ListOptions {Page : 3 , PageSize : 2 }},
115115		[]int64 {19 , 25 })
116116
117- 	testOrgSuccess (& user_model.SearchUserOptions {OrderBy : "id ASC" , ListOptions : db.ListOptions {Page : 4 , PageSize : 2 }},
117+ 	testOrgSuccess (user_model.SearchUserOptions {OrderBy : "id ASC" , ListOptions : db.ListOptions {Page : 4 , PageSize : 2 }},
118118		[]int64 {26 , 41 })
119119
120- 	testOrgSuccess (& user_model.SearchUserOptions {OrderBy : "id ASC" , ListOptions : db.ListOptions {Page : 5 , PageSize : 2 }},
120+ 	testOrgSuccess (user_model.SearchUserOptions {OrderBy : "id ASC" , ListOptions : db.ListOptions {Page : 5 , PageSize : 2 }},
121121		[]int64 {42 })
122122
123- 	testOrgSuccess (& user_model.SearchUserOptions {ListOptions : db.ListOptions {Page : 6 , PageSize : 2 }},
123+ 	testOrgSuccess (user_model.SearchUserOptions {ListOptions : db.ListOptions {Page : 6 , PageSize : 2 }},
124124		[]int64 {})
125125
126126	// test users 
127- 	testUserSuccess  :=  func (opts  * user_model.SearchUserOptions , expectedUserIDs  []int64 ) {
127+ 	testUserSuccess  :=  func (opts  user_model.SearchUserOptions , expectedUserIDs  []int64 ) {
128128		opts .Type  =  user_model .UserTypeIndividual 
129129		testSuccess (opts , expectedUserIDs )
130130	}
131131
132- 	testUserSuccess (& user_model.SearchUserOptions {OrderBy : "id ASC" , ListOptions : db.ListOptions {Page : 1 }},
132+ 	testUserSuccess (user_model.SearchUserOptions {OrderBy : "id ASC" , ListOptions : db.ListOptions {Page : 1 }},
133133		[]int64 {1 , 2 , 4 , 5 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 18 , 20 , 21 , 24 , 27 , 28 , 29 , 30 , 32 , 34 , 37 , 38 , 39 , 40 })
134134
135- 	testUserSuccess (& user_model.SearchUserOptions {ListOptions : db.ListOptions {Page : 1 }, IsActive : optional .Some (false )},
135+ 	testUserSuccess (user_model.SearchUserOptions {ListOptions : db.ListOptions {Page : 1 }, IsActive : optional .Some (false )},
136136		[]int64 {9 })
137137
138- 	testUserSuccess (& user_model.SearchUserOptions {OrderBy : "id ASC" , ListOptions : db.ListOptions {Page : 1 }, IsActive : optional .Some (true )},
138+ 	testUserSuccess (user_model.SearchUserOptions {OrderBy : "id ASC" , ListOptions : db.ListOptions {Page : 1 }, IsActive : optional .Some (true )},
139139		[]int64 {1 , 2 , 4 , 5 , 8 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 18 , 20 , 21 , 24 , 27 , 28 , 29 , 30 , 32 , 34 , 37 , 38 , 39 , 40 })
140140
141- 	testUserSuccess (& user_model.SearchUserOptions {Keyword : "user1" , OrderBy : "id ASC" , ListOptions : db.ListOptions {Page : 1 }, IsActive : optional .Some (true )},
141+ 	testUserSuccess (user_model.SearchUserOptions {Keyword : "user1" , OrderBy : "id ASC" , ListOptions : db.ListOptions {Page : 1 }, IsActive : optional .Some (true )},
142142		[]int64 {1 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 18 })
143143
144144	// order by name asc default 
145- 	testUserSuccess (& user_model.SearchUserOptions {Keyword : "user1" , ListOptions : db.ListOptions {Page : 1 }, IsActive : optional .Some (true )},
145+ 	testUserSuccess (user_model.SearchUserOptions {Keyword : "user1" , ListOptions : db.ListOptions {Page : 1 }, IsActive : optional .Some (true )},
146146		[]int64 {1 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 18 })
147147
148- 	testUserSuccess (& user_model.SearchUserOptions {ListOptions : db.ListOptions {Page : 1 }, IsAdmin : optional .Some (true )},
148+ 	testUserSuccess (user_model.SearchUserOptions {ListOptions : db.ListOptions {Page : 1 }, IsAdmin : optional .Some (true )},
149149		[]int64 {1 })
150150
151- 	testUserSuccess (& user_model.SearchUserOptions {ListOptions : db.ListOptions {Page : 1 }, IsRestricted : optional .Some (true )},
151+ 	testUserSuccess (user_model.SearchUserOptions {ListOptions : db.ListOptions {Page : 1 }, IsRestricted : optional .Some (true )},
152152		[]int64 {29 })
153153
154- 	testUserSuccess (& user_model.SearchUserOptions {ListOptions : db.ListOptions {Page : 1 }, IsProhibitLogin : optional .Some (true )},
154+ 	testUserSuccess (user_model.SearchUserOptions {ListOptions : db.ListOptions {Page : 1 }, IsProhibitLogin : optional .Some (true )},
155155		[]int64 {37 })
156156
157- 	testUserSuccess (& user_model.SearchUserOptions {ListOptions : db.ListOptions {Page : 1 }, IsTwoFactorEnabled : optional .Some (true )},
157+ 	testUserSuccess (user_model.SearchUserOptions {ListOptions : db.ListOptions {Page : 1 }, IsTwoFactorEnabled : optional .Some (true )},
158158		[]int64 {24 })
159159}
160160
0 commit comments