fix tests
This commit is contained in:
parent
36565ea168
commit
3941e1a5cd
3 changed files with 5 additions and 1 deletions
|
@ -11,6 +11,8 @@ class TestClient:
|
||||||
content = "".join(open(file_path).readlines())
|
content = "".join(open(file_path).readlines())
|
||||||
if path.endswith('html'):
|
if path.endswith('html'):
|
||||||
content = BeautifulSoup(content, 'html.parser')
|
content = BeautifulSoup(content, 'html.parser')
|
||||||
|
for script in content(["noscript"]): # Remove extra tags
|
||||||
|
script.extract()
|
||||||
return content
|
return content
|
||||||
|
|
||||||
def build_path(self, path):
|
def build_path(self, path):
|
||||||
|
|
|
@ -27,6 +27,8 @@ class CorePagesTestCase(TestCase):
|
||||||
def test_has_scripts(self):
|
def test_has_scripts(self):
|
||||||
content = self.client.get('index.html')
|
content = self.client.get('index.html')
|
||||||
for script in content.find_all('script'):
|
for script in content.find_all('script'):
|
||||||
|
if script.attrs.get('id') == 'piwik':
|
||||||
|
continue
|
||||||
self.client.exists(script.attrs['src'])
|
self.client.exists(script.attrs['src'])
|
||||||
|
|
||||||
def test_has_stylesheet(self):
|
def test_has_stylesheet(self):
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{% if BUILD_PRODUCTION %}
|
{% if BUILD_PRODUCTION %}
|
||||||
<!-- Piwik -->
|
<!-- Piwik -->
|
||||||
<script type="text/javascript">
|
<script type="text/javascript" id="piwik">
|
||||||
var _paq = _paq || [];
|
var _paq = _paq || [];
|
||||||
_paq.push(["setDomains", ["*.theorangeone.net"]]);
|
_paq.push(["setDomains", ["*.theorangeone.net"]]);
|
||||||
_paq.push(['trackPageView']);
|
_paq.push(['trackPageView']);
|
||||||
|
|
Reference in a new issue