Skip to content

Commit 65d505e

Browse files
committed
Fixed some bugs in the method which saves a copy of a page which failed a
testurl diff test. - Legacy-Id: 6450
1 parent 6a9e9da commit 65d505e

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

ietf/utils/test_utils.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,12 @@ def saveBadResponse(self, url, response):
140140
url = url.lstrip('/')
141141
path = settings.TEST_DIFF_FAILURE_DIR
142142
path = os.path.join(path, url)
143-
if not os.path.exist(os.path.dirname(path)):
144-
os.mkdir(os.path.dirname(path))
145-
with open(path) as file:
146-
file.write(response)
143+
if not os.path.exists(os.path.dirname(path)):
144+
os.makedirs(os.path.dirname(path))
145+
with open(path, "w") as file:
146+
file.write(response.content)
147147
msg += "The newly generated page has been saved at:\n %s" % path
148+
print msg
148149
return msg
149150

150151
def doTestUrl(self, tuple):

0 commit comments

Comments
 (0)