Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

selecting single columns does not work #21

Open
filthysocks opened this issue Jul 8, 2019 · 5 comments
Open

selecting single columns does not work #21

filthysocks opened this issue Jul 8, 2019 · 5 comments

Comments

@filthysocks
Copy link

Selecting single columns does not work for me.
eg. the following is not working

db = UnifiedAlchemyMagicMock()
db.session.query(MyTable.col).all()
@miki725
Copy link
Owner

miki725 commented Jul 8, 2019

what is the error?

@filthysocks
Copy link
Author

none, it just returns an empty list
but if run it on all columns

db = UnifiedAlchemyMagicMock()
db.session.query(MyTable).all()

i get results.
The column alwalys has a value

@miki725
Copy link
Owner

miki725 commented Jul 8, 2019

how do you provide data to UnifiedAlchemyMagicMock? 2 provided examples should return empty list unless you do something else

@AlaricWhitney
Copy link

AlaricWhitney commented Apr 15, 2020

I've proven out that selecting columns doesn't work:

session = UnifiedAlchemyMagicMock()
session.add(Model(col1=1, col2=2))
v = session.query(Model.col2).first()
assert v.col2 == 2
# None - assert fails
session = UnifiedAlchemyMagicMock()
session.add(Model(col1=1, col2=2))
v = session.query(Model).first()
assert v.col2 == 2
# 2 - assert passes

@rgreweldinger
Copy link

Were there any updates on this? I'm running into the same issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants