Test bad username in basic auth backend

This commit is contained in:
Alexandre Iooss 2020-10-09 23:19:53 +02:00
parent 431bc2e7de
commit 0fd1611836
No known key found for this signature in database
GPG Key ID: 6C79278F3FCDCC02
1 changed files with 7 additions and 1 deletions

View File

@ -15,7 +15,13 @@ func TestBasicLogin(t *testing.T) {
t.Error("Error while logging with the basic authentication:", err)
}
// Test bad credentials
// Test bad username
ok, err = backend.Login("baduser", "demo")
if ok {
t.Error("Authentification failed to fail:", err)
}
// Test bad password
ok, err = backend.Login("demo", "badpass")
if ok {
t.Error("Authentification failed to fail:", err)