Skip to content

Commit aba408f

Browse files
committed
test(orm): fix polymorphic relation tests to use the record relationship
The Like model's MorphTo relationship is named 'record'; the tests referenced a nonexistent 'like.log' attribute, which returned None and failed to await / assert. Aligns with the eager-load case that already uses with_('record').
1 parent cd1dee8 commit aba408f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

fastapi_startkit/tests/masoniteorm/sqlite/relationships/test_sqlite_polymorphic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ class TestRelationships(TestCase):
99
async def test_can_get_polymorphic_relation(self):
1010
likes = await Like.get()
1111
for like in likes:
12-
record = await like.log
12+
record = await like.record
1313
assert isinstance(record, (Articles, Product))
1414

1515
async def test_can_get_eager_load_polymorphic_relation(self):
1616
likes = await Like.with_("record").get()
1717
for like in likes:
18-
assert isinstance(like.log, (Articles, Product))
18+
assert isinstance(like.record, (Articles, Product))

0 commit comments

Comments
 (0)