Fixed some bugs in the method which saves a copy of a page which failed a
testurl diff test. - Legacy-Id: 6450
This commit is contained in:
parent
6a9e9dac55
commit
65d505edf3
|
@ -140,11 +140,12 @@ class SimpleUrlTestCase(django.test.TestCase,RealDatabaseTest):
|
||||||
url = url.lstrip('/')
|
url = url.lstrip('/')
|
||||||
path = settings.TEST_DIFF_FAILURE_DIR
|
path = settings.TEST_DIFF_FAILURE_DIR
|
||||||
path = os.path.join(path, url)
|
path = os.path.join(path, url)
|
||||||
if not os.path.exist(os.path.dirname(path)):
|
if not os.path.exists(os.path.dirname(path)):
|
||||||
os.mkdir(os.path.dirname(path))
|
os.makedirs(os.path.dirname(path))
|
||||||
with open(path) as file:
|
with open(path, "w") as file:
|
||||||
file.write(response)
|
file.write(response.content)
|
||||||
msg += "The newly generated page has been saved at:\n %s" % path
|
msg += "The newly generated page has been saved at:\n %s" % path
|
||||||
|
print msg
|
||||||
return msg
|
return msg
|
||||||
|
|
||||||
def doTestUrl(self, tuple):
|
def doTestUrl(self, tuple):
|
||||||
|
|
Loading…
Reference in a new issue