mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 10:59:42 +08:00
fix compatibility in Python version < 3.6
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import time
|
||||
import unittest
|
||||
@@ -537,10 +538,12 @@ class TestHttpRunner(ApiServerUnittest):
|
||||
}
|
||||
report_path = self.runner.run(tests_mapping)
|
||||
with open(report_path) as f:
|
||||
self.assertIn(
|
||||
""<img src=x onerror=alert(1)>"}'",
|
||||
f.read()
|
||||
content = f.read()
|
||||
m = re.findall(
|
||||
re.escape(""person": "<img src=x onerror=alert(1)>""),
|
||||
content
|
||||
)
|
||||
self.assertEqual(len(m), 2)
|
||||
|
||||
|
||||
class TestApi(ApiServerUnittest):
|
||||
|
||||
Reference in New Issue
Block a user