Skip to content

Commit

Permalink
add missing test
Browse files Browse the repository at this point in the history
  • Loading branch information
devkral committed Jan 21, 2025
1 parent 3030691 commit 1d46935
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/reflection/test_table_reflection_schemes.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,16 @@ async def test_can_reflect_existing_table():
assert len(users) == 1


async def test_can_defer_loading():
await HubUser.query.create(name="Test", title="a title", description="desc")

user = await ReflectedUser.query.defer("description").get()

assert "description" not in user.__dict__
assert user.description == "desc"
assert "description" in user.__dict__


async def test_can_reflect_existing_table_with_not_all_fields():
await HubUser.query.create(name="Test", title="a title", description="desc")

Expand Down

0 comments on commit 1d46935

Please sign in to comment.