mirror of
https://github.com/Xevion/linkpulse.git
synced 2025-12-17 02:12:16 -06:00
Add test_session, add randomizers, move test_app, user/session fixtures
This commit is contained in:
15
backend/linkpulse/tests/random.py
Normal file
15
backend/linkpulse/tests/random.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import random
|
||||
import string
|
||||
import time
|
||||
|
||||
|
||||
def epoch() -> int:
|
||||
return int(time.time())
|
||||
|
||||
|
||||
def random_string(length: int = 10) -> str:
|
||||
return "".join(random.choices(string.ascii_lowercase + string.digits, k=length))
|
||||
|
||||
|
||||
def random_email() -> str:
|
||||
return random_string() + str(epoch()) + "@example.com"
|
||||
Reference in New Issue
Block a user