diff --git a/models/user/user_test.go b/models/user/user_test.go
index 0e08529156..d89f99b871 100644
--- a/models/user/user_test.go
+++ b/models/user/user_test.go
@@ -556,6 +556,11 @@ func Test_ValidateUser(t *testing.T) {
 }
 
 func Test_NormalizeUserFromEmail(t *testing.T) {
+	oldSetting := setting.Service.AllowDotsInUsernames
+	defer func() {
+		setting.Service.AllowDotsInUsernames = oldSetting
+	}()
+	setting.Service.AllowDotsInUsernames = true
 	testCases := []struct {
 		Input             string
 		Expected          string