mirror of
https://git.linux-kernel.at/oliver/ivatar.git
synced 2025-11-18 22:18:02 +00:00
Add helper function to generate a random mail address
This commit is contained in:
@@ -178,6 +178,16 @@ def random_string(length=10):
|
||||
)
|
||||
|
||||
|
||||
def generate_random_email():
|
||||
"""
|
||||
Generate a random email address using the same pattern as test_views.py
|
||||
"""
|
||||
username = random_string()
|
||||
domain = random_string()
|
||||
tld = random_string(2)
|
||||
return f"{username}@{domain}.{tld}"
|
||||
|
||||
|
||||
def random_ip_address():
|
||||
"""
|
||||
Return a random IP address (IPv4)
|
||||
|
||||
Reference in New Issue
Block a user