test nonsense

This commit is contained in:
grumbulon 2023-03-18 14:38:58 -04:00
parent d3b25bab59
commit 60b7d67550

View file

@ -67,16 +67,11 @@ func TestAPI(t *testing.T) {
tester := Init(ts.URL)
// test mode
mode = "test"
db, err, ok := db.InitDb(config.DB, mode)
if err != nil && !ok {
assert.NotNil(t, err)
}
db, err, _ := db.InitDb(config.DB, mode)
assert.Nil(t, err)
hashedPassword, err := bcrypt.GenerateFromPassword([]byte(tester.password), bcrypt.DefaultCost)
if err != nil {
assert.NotNil(t, err)
}
assert.Nil(t, err)
db.Create(&internal.User{Username: tester.username, HashedPassword: string(hashedPassword)})