tokens = ["Тест", "Тест2"]
cursor.execute("SELECT MAX(category_id) FROM stories WHERE category = %s", tokens)
cursor.execute("SELECT MAX(category_id) FROM stories WHERE category = %s", ["Тест"])
cursor.execute("SELECT MAX(category_id) FROM stories WHERE category = %s", ["Тест2"])
SELECT MAX(category_id) FROM stories
WHERE category = ANY(ARRAY['Тест', 'Тест2']);