diff --git a/frappe/core/doctype/user/test_user.py b/frappe/core/doctype/user/test_user.py index 72650679ae..d901bfa608 100644 --- a/frappe/core/doctype/user/test_user.py +++ b/frappe/core/doctype/user/test_user.py @@ -283,6 +283,11 @@ class TestUser(unittest.TestCase): self.assertTupleEqual(sign_up(random_user, random_user_name, "/welcome"), (0, "Registered but disabled")) + # throttle user creation + with patch.object(user_module.frappe.db, "get_creation_count", return_value=301): + self.assertRaisesRegex(frappe.exceptions.ValidationError, "Throttled", + sign_up, frappe.mock('email'), random_user_name, "/signup") + def test_reset_password(self): from frappe.utils import set_request