recopytex/tests/integration/test_orm.py

16 lines
421 B
Python

from backend.adapters.orm import metadata, start_mappers
from backend.model.tribe import Tribe
def test_tribes_mapper_can_load_tribe(session):
session.execute(
"INSERT INTO tribes (name, level) VALUES "
"('tribe1', '2nd'),"
"('tribe2', '1ST')"
)
expected = [
(Tribe("tribe1", "2nd")),
(Tribe("tribe2", "1ST")),
]
assert session.query(Tribe).all() == expected