Simplify your test assertions forever.
In some tests it's common to get a random ID back from a database. Your assertions are simpler when you substitute a Variable object for the expected value.
from pyariable import Variable
def test_list():
x = Variable()
y = Variable()
assert [
{"db_id": 590, "name": "alice"},
{"db_id": 590, "name": "bob"},
{"db_id": 999, "name": "charlie"},
] == [
{"db_id": x, "name": "alice"},
{"db_id": x, "name": "bob"},
{"db_id": y, "name": "charlie"},
]
assert x != y
assert x < y