[WIP] Link hike to places
This commit is contained in:
14
backend/app/tests/utils/place.py
Normal file
14
backend/app/tests/utils/place.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from sqlmodel import Session
|
||||
|
||||
from app.models.place import Place, PlaceCreate
|
||||
from app.tests.utils.utils import random_lower_string, random_lower_short_string
|
||||
|
||||
|
||||
def create_random_place(db: Session, name: str = None) -> Place:
|
||||
if not name:
|
||||
name = random_lower_string()
|
||||
|
||||
short_name = random_lower_short_string()
|
||||
|
||||
place_in = PlaceCreate(name=name, short_name=short_name)
|
||||
return Place.create(session=db, create_obj=place_in)
|
||||
Reference in New Issue
Block a user