Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

tests: Stop adding an api_by_user rate limit always.

Alex Vandiverf0532aecc8ae
diff --git a/zerver/tests/test_external.py b/zerver/tests/test_external.py
index 8d67703bc67..6c67a63161c 100644
--- a/zerver/tests/test_external.py
+++ b/zerver/tests/test_external.py
@@ -97,11 +97,9 @@ class RateLimitTests(ZulipTestCase):
self.api_get(user, "/api/v1/messages")
settings.RATE_LIMITING = True
- add_ratelimit_rule(1, 5)
def tearDown(self) -> None:
settings.RATE_LIMITING = False
- remove_ratelimit_rule(1, 5)
super().tearDown()
@@ -189,6 +187,7 @@ class RateLimitTests(ZulipTestCase):
self.assertNotEqual(result.status_code, 429)
+ @rate_limit_rule(1, 5, domain="api_by_user")
def test_hit_ratelimits_as_user(self) -> None:
user = self.example_user("cordelia")
RateLimitedUser(user).clear_history()