Correct event testing
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user