Correct event testing

This commit is contained in:
Sebastiaan
2025-06-09 14:38:47 +02:00
parent b590d58c74
commit 5aab2add76
3 changed files with 38 additions and 15 deletions

View File

@@ -4,8 +4,12 @@ from app.models.event import Event, EventCreate
from app.tests.utils.utils import random_email, random_lower_string
def create_random_event(db: Session) -> Event:
name = random_lower_string()
contact = random_email()
def create_random_event(db: Session, name: str = None, contact: str = None) -> Event:
if not name:
name = random_lower_string()
if not contact:
contact = random_email()
event_in = EventCreate(name=name, contact=contact)
return Event.create(session=db, create_obj=event_in)