readability

This commit is contained in:
evilchili 2025-09-29 23:50:23 -07:00
parent 40b6650970
commit bafaf043e3

View File

@ -67,15 +67,17 @@ def test_subgroups(db):
tos = db.save(examples.Group(name="The Original Series", members=[kirk])) tos = db.save(examples.Group(name="The Original Series", members=[kirk]))
snw = db.save(examples.Group(name="Strange New Worlds", members=[pike])) snw = db.save(examples.Group(name="Strange New Worlds", members=[pike]))
starfleet = db.save(examples.Group(name="Starfleet", groups=[tos, snw])) trek = db.save(examples.Group(name="trek", groups=[tos, snw]))
tos = db.table("Group").get(doc_id=tos.doc_id) tos = db.table("Group").get(doc_id=tos.doc_id)
snw = db.table("Group").get(doc_id=snw.doc_id) snw = db.table("Group").get(doc_id=snw.doc_id)
assert tos in starfleet.groups assert tos in trek.groups
assert snw in starfleet.groups assert snw in trek.groups
assert tos.parent.uid == starfleet.uid assert trek.parent is None
assert tos.parent.uid == trek.uid
assert snw.parent.uid == trek.uid
unique_users = set([user for group in starfleet.groups for user in group.members]) unique_users = set([user for group in trek.groups for user in group.members])
kirk = db.table("User").get(doc_id=kirk.doc_id) kirk = db.table("User").get(doc_id=kirk.doc_id)
assert kirk in unique_users assert kirk in unique_users