Check that permissions are working when accessing to API pages
Signed-off-by: Yohann D'ANELLO <yohann.danello@gmail.com>
This commit is contained in:
parent
5cb4183e9f
commit
f570ff3cd5
8 changed files with 193 additions and 14 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import sys
|
||||
from functools import lru_cache
|
||||
from time import time
|
||||
|
||||
|
|
@ -38,6 +38,10 @@ def memoize(f):
|
|||
|
||||
nonlocal last_collect
|
||||
|
||||
if "test" in sys.argv:
|
||||
# In a test environment, don't memoize permissions
|
||||
return f(*args, **kwargs)
|
||||
|
||||
if time() - last_collect > 60:
|
||||
# Clear cache
|
||||
collect()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue