Spaces:
Runtime error
Runtime error
Commit ·
d454ab0
1
Parent(s): afc114b
Worked with scope what is it and what does it do in test/database.py
Browse filesFiles changed (2)
11 unmodified lines12131415151617183 unmodified lines222324252526272811 unmodified linesengine = create_engine(SQLALCHEMY_DATABASE_URL)TestingSessionMaker = sessionmaker(autoflush=False, autocommit=False, bind=engine)
@pytest.fixture@pytest.fixture(scope="module")def session(): Base.metadata.drop_all(bind=engine) Base.metadata.create_all(bind=engine)3 unmodified lines finally: db.close()
@pytest.fixture@pytest.fixture(scope="module")def client(session): def override_get_db(): try:9 unmodified lines1011121313141516179 unmodified lines response = client.post("/users/", json={"email": "abdullah@gmail.com", "password": "abdullah1234"}) new_user = user.UserResponse(**response.json()) assert response.status_code == 201 assert new_user.email == "abdullah@gmail.com" assert new_user.email == "abdullah@gmail.com"
def test_login_user(client): response = client.post("/login", data={"username": "abdullah@gmail.com", "password": "abdullah1234"}) assert response.status_code==200tests/database.py+2-2
tests/test_users.py+5-1