MCPcopy
hub / github.com/fastapi/full-stack-fastapi-template / create_random_item

Function create_random_item

backend/tests/utils/item.py:9–16  ·  view source on GitHub ↗
(db: Session)

Source from the content-addressed store, hash-verified

7
8
9def create_random_item(db: Session) -> Item:
10 user = create_random_user(db)
11 owner_id = user.id
12 assert owner_id is not None
13 title = random_lower_string()
14 description = random_lower_string()
15 item_in = ItemCreate(title=title, description=description)
16 return crud.create_item(session=db, item_in=item_in, owner_id=owner_id)

Callers 7

test_read_itemFunction · 0.90
test_read_itemsFunction · 0.90
test_update_itemFunction · 0.90
test_delete_itemFunction · 0.90

Calls 3

create_random_userFunction · 0.90
random_lower_stringFunction · 0.90
ItemCreateClass · 0.90

Tested by 7

test_read_itemFunction · 0.72
test_read_itemsFunction · 0.72
test_update_itemFunction · 0.72
test_delete_itemFunction · 0.72