测试用户删除接口时,需要使用执行 sql 语句初始化,创建专门用来创建测试接口的用户,新建用户中的密码是需要加密的,加密后基本都有 $ 符号:
'insert into rdb_server_jdbc_db.users values(100,"user_for_test_delete_api","$2a$15$QeuSCLP8s8r5xMJsW9xcGe8f7EeI7YJCrWlLlabbYWX2R7VBFwwXy",1,"user_for_test_delete_api","user@example.com","2021-11-30 01:56:40","2021-11-30 01:56:40");',
但是在 httprunner3 中,$2a$15$QeuSCLP8s8r5xMJsW9xcGe8f7EeI7YJCrWlLlabbYWX2R7VBFwwXy 被解析为 3 个变量,导致报错:
raise exceptions.VariableNotFound(not_defined_variables)
E httprunner.exceptions.VariableNotFound: ['QeuSCLP8s8r5xMJsW9xcGe8f7EeI7YJCrWlLlabbYWX2R7VBFwwXy', '2a', '15']
使用了\,$$ 进行转移,仍然要报错,请问大家有什么解决办法呢