diff --git a/tests/__init__.py b/tests/__init__.py index 96548d5..7632174 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -11,6 +11,8 @@ class TestClient: content = "".join(open(file_path).readlines()) if path.endswith('html'): content = BeautifulSoup(content, 'html.parser') + for script in content(["noscript"]): # Remove extra tags + script.extract() return content def build_path(self, path): diff --git a/tests/tests_common.py b/tests/tests_common.py index 5c3bb9b..201980f 100644 --- a/tests/tests_common.py +++ b/tests/tests_common.py @@ -27,6 +27,8 @@ class CorePagesTestCase(TestCase): def test_has_scripts(self): content = self.client.get('index.html') for script in content.find_all('script'): + if script.attrs.get('id') == 'piwik': + continue self.client.exists(script.attrs['src']) def test_has_stylesheet(self): diff --git a/theme/templates/extras/piwik.html b/theme/templates/extras/piwik.html index 335772b..4dd3698 100644 --- a/theme/templates/extras/piwik.html +++ b/theme/templates/extras/piwik.html @@ -1,6 +1,6 @@ {% if BUILD_PRODUCTION %} -