From 2d542bbd30f137147a23cb6237ec3b5c9c7454a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Mon, 24 May 2021 17:47:38 +0200 Subject: [PATCH] Removing unneeded test --- server/services/auth/password_test.go | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/server/services/auth/password_test.go b/server/services/auth/password_test.go index cdde59e29..0449d74b9 100644 --- a/server/services/auth/password_test.go +++ b/server/services/auth/password_test.go @@ -1,7 +1,6 @@ package auth import ( - "math/rand" "strings" "testing" @@ -16,28 +15,6 @@ func TestPasswordHash(t *testing.T) { assert.False(t, ComparePassword(hash, "Test2"), "Passwords should not have matched") } -func TestGeneratePassword(t *testing.T) { - passwordRandomSource = rand.NewSource(12345) - - t.Run("Should be the minimum length or 4, whichever is less", func(t *testing.T) { - password1 := GeneratePassword(5) - assert.Len(t, password1, 5) - password2 := GeneratePassword(10) - assert.Len(t, password2, 10) - password3 := GeneratePassword(1) - assert.Len(t, password3, 4) - }) - - t.Run("Should contain at least one of symbols, upper case, lower case and numbers", func(t *testing.T) { - password := GeneratePassword(4) - require.Len(t, password, 4) - assert.Contains(t, []rune(PasswordUpperCaseLetters), []rune(password)[0]) - assert.Contains(t, []rune(PasswordNumbers), []rune(password)[1]) - assert.Contains(t, []rune(PasswordLowerCaseLetters), []rune(password)[2]) - assert.Contains(t, []rune(PasswordSpecialChars), []rune(password)[3]) - }) -} - func TestIsPasswordValidWithSettings(t *testing.T) { for name, tc := range map[string]struct { Password string