File tree Expand file tree Collapse file tree 3 files changed +6
-15
lines changed
backend/app/tests/crud/documents Expand file tree Collapse file tree 3 files changed +6
-15
lines changed Original file line number Diff line number Diff line change 33from pathlib import Path
44
55from sqlmodel import Session , delete
6- from sqlalchemy .exc import IntegrityError
7- from sqlalchemy .dialects .sqlite import insert
86
9- from app .crud import DocumentCrud
107from app .core .config import settings
118from app .crud .user import get_user_by_email
12- from app .models import Document , UserCreate
9+ from app .models import Document
1310
1411@ft .cache
1512def get_user_id_by_email (session : Session ):
@@ -25,14 +22,12 @@ def rm_documents(session: Session):
2522 session .commit ()
2623
2724def insert_documents (session : Session , n : int ):
28- crud = DocumentCrud (session )
29- docs = DocumentMaker (session )
30-
31- for (_ , d ) in zip (range (n ), docs ):
32- session .add (d )
25+ documents = DocumentMaker (session )
26+ for (_ , doc ) in zip (range (n ), documents ):
27+ session .add (doc )
3328 session .commit ()
34- session .refresh (d )
35- yield d
29+ session .refresh (doc )
30+ yield doc
3631
3732def insert_document (session : Session ):
3833 (document , ) = insert_documents (session , 1 )
Original file line number Diff line number Diff line change 22from sqlmodel import Session
33
44from app .crud import DocumentCrud
5- from app .core .config import settings
65
76from _utils import (
87 Constants ,
Original file line number Diff line number Diff line change 1- from uuid import UUID
2- from typing import ClassVar
3-
41import pytest
52from sqlmodel import Session
63
You can’t perform that action at this time.
0 commit comments