See #261: Added a rate-limiting (throttling system) to limit the number of requests handled per user/IP

This commit is contained in:
Eliot Berriot 2019-09-17 11:23:59 +02:00
commit d28bf65d00
20 changed files with 1077 additions and 19 deletions

View file

@ -5,6 +5,7 @@ import PIL
import random
import shutil
import tempfile
import time
import factory
import pytest
@ -308,6 +309,13 @@ def now(mocker):
return now
@pytest.fixture()
def now_time(mocker):
now = time.time()
mocker.patch("time.time", return_value=now)
return now
@pytest.fixture()
def avatar():
i = PIL.Image.new("RGBA", (400, 400), random.choice(["red", "blue", "yellow"]))