--- a/Allura/allura/tests/helpers.py
+++ b/Allura/allura/tests/helpers.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
from os import path, environ, getcwd
import os
+import sys
import logging
import tempfile
import subprocess
@@ -29,6 +30,7 @@
DFL_CONFIG = environ.get('SF_SYSTEM_FUNC') and 'sandbox-test.ini' or 'test.ini'
DFL_APP_NAME = 'main_without_authn'
+ENABLE_CONTENT_VALIDATION = False
log = logging.getLogger(__name__)
@@ -203,7 +205,11 @@
f.close()
message = "Validation errors (" + f.name + "):\n" + resp
message = message.decode('ascii','ignore')
- ok_(False, message)
+ if ENABLE_CONTENT_VALIDATION:
+ ok_(False, message)
+ else:
+ sys.stderr.write('=' * 40 + '\n' + msg + '\n')
+
def validate_html5_chunk(html):
""" When you don't have a html & body tags - this adds it"""
@@ -234,7 +240,11 @@
os.unlink(f.name)
return
stdout = stdout.decode('UTF-8', 'replace')
- raise Exception('JavaScript validation error(s) (see ' + f.name + '): ' + '\n'.join(repr(s) for s in stdout.split('\n') if s))
+ msg = 'JavaScript validation error(s) (see ' + f.name + '): ' + '\n'.join(repr(s) for s in stdout.split('\n') if s)
+ if ENABLE_CONTENT_VALIDATION:
+ raise Exception(msg)
+ else:
+ sys.stderr.write('=' * 40 + '\n' + msg + '\n')
def validate_page(html_or_response):
validate_html(html_or_response)