()
| 226 | } |
| 227 | |
| 228 | func (s *UserSuite) Test_CreateUser_Anonymous() { |
| 229 | s.noLogin() |
| 230 | |
| 231 | s.ctx.Request = httptest.NewRequest("POST", "/user", strings.NewReader(`{"name": "tom", "pass": "1", "admin": false}`)) |
| 232 | s.ctx.Request.Header.Set("Content-Type", "application/json") |
| 233 | |
| 234 | s.a.CreateUser(s.ctx) |
| 235 | |
| 236 | assert.Equal(s.T(), 401, s.recorder.Code) |
| 237 | s.db.AssertUsernameNotExist("tom") |
| 238 | } |
| 239 | |
| 240 | func (s *UserSuite) Test_CreateUser_Register_Anonymous() { |
| 241 | s.a.Registration = true |
nothing calls this directly
no test coverage detected