@@ -1,6 +1,7 @@
|
||||
# retoor <retoor@molodetz.nl>
|
||||
|
||||
import devplacepy.main as m
|
||||
import devplacepy.middleware.state as st
|
||||
from starlette.testclient import TestClient
|
||||
def _patch_limits(monkeypatch, limit, window=60):
|
||||
def fake_get_int_setting(key, default):
|
||||
@@ -9,10 +10,10 @@ def _patch_limits(monkeypatch, limit, window=60):
|
||||
"rate_limit_window_seconds": window,
|
||||
}.get(key, default)
|
||||
|
||||
monkeypatch.setattr(m, "get_int_setting", fake_get_int_setting)
|
||||
monkeypatch.setattr(st, "get_int_setting", fake_get_int_setting)
|
||||
# conftest disables the limiter suite-wide; re-enable it for these tests only.
|
||||
monkeypatch.setattr(m, "RATE_LIMIT_DISABLED", False)
|
||||
m._rate_limit_store.clear()
|
||||
monkeypatch.setattr(st, "RATE_LIMIT_DISABLED", False)
|
||||
st._rate_limit_store.clear()
|
||||
import requests
|
||||
from tests.conftest import BASE_URL
|
||||
def _seed_news_seo():
|
||||
|
||||
Reference in New Issue
Block a user