Fix: remove can_load_student test

This commit is contained in:
Bertrand Benjamin 2022-12-27 06:59:36 +01:00
parent 7d908775a9
commit 2dc1cf6fb8

View File

@ -41,25 +41,3 @@ def test_tribe_mapper_can_save_and_load_tribe(session):
session.commit() session.commit()
assert session.query(Tribe).all() == [tribe] assert session.query(Tribe).all() == [tribe]
def test_students_mapper_can_load_student(session):
session.execute("INSERT INTO tribes (name, level) VALUES " "('tribe1', '2nd')")
session.execute(
"INSERT INTO students (id, name, tribe_name) VALUES "
"('1', 'student1', 'tribe1'),"
"('2', 'student2', 'tribe1')"
)
tribe = session.query(Tribe).one()
expected = [
(Student("1", "student1", tribe)),
(Student("2", "student2", tribe)),
]
with session.no_autoflush:
students = session.query(Student).all()
assert set(tribe.students) == set(expected)
assert students == expected