mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix(test_auth): cover mismatched referer situation
Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
043ac7fe92
commit
112837e0e9
2 changed files with 31 additions and 3 deletions
|
@ -1,3 +1,5 @@
|
|||
from typing import Dict
|
||||
|
||||
import aurweb.config
|
||||
|
||||
|
||||
|
@ -27,7 +29,13 @@ class URL:
|
|||
class Request:
|
||||
""" A fake Request object which mimics a FastAPI Request for tests. """
|
||||
client = Client()
|
||||
cookies = dict()
|
||||
headers = dict()
|
||||
user = User()
|
||||
url = URL()
|
||||
|
||||
def __init__(self,
|
||||
method: str = "GET",
|
||||
headers: Dict[str, str] = dict(),
|
||||
cookies: Dict[str, str] = dict()) -> "Request":
|
||||
self.method = method.upper()
|
||||
self.headers = headers
|
||||
self.cookies = cookies
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue