Spaces:
Running
Running
File size: 687 Bytes
0359012 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
from sqlalchemy.orm import Session
from app.core.database import SessionLocal
from faker import Faker
fake = Faker()
def override_get_db():
"""
Override the get_db function for testing
"""
try:
db = SessionLocal()
yield db
finally:
db.close()
def get_db():
"""
Get a new database session
"""
try:
db = SessionLocal()
yield db
finally:
db.close()
def fake_user_details():
test_user_details = {
"email": fake.email(),
"username": fake.user_name(),
"password": fake.password(),
}
return test_user_details
def get_new_fake_pwd():
return fake.password()
|