make assertion inside lettuce instead of in sql

reason: error message is clearer