2
0
mirror of https://github.com/frappe/frappe.git synced 2024-06-12 15:22:23 +00:00

test: fix anticipiated test failures

This commit is contained in:
Ankush Menat 2022-07-13 14:39:25 +05:30
parent 7c1b96bc62
commit 015937a03a
2 changed files with 3 additions and 2 deletions

View File

@ -37,6 +37,7 @@ repos:
hooks:
- id: prettier
types_or: [javascript]
# Ignore any files that might contain jinja / bundles
exclude: |
(?x)^(
frappe/public/dist/.*|

View File

@ -263,13 +263,13 @@ class TestWebsite(unittest.TestCase):
def test_colocated_assets(self):
content = get_response_content("/_test/_test_folder/_test_page")
self.assertIn("<script>console.log('test data');</script>", content)
self.assertIn("""<script>console.log("test data");\n</script>""", content)
self.assertIn("background-color: var(--bg-color);", content)
def test_raw_assets_are_loaded(self):
content = get_response_content("/_test/assets/js_asset.min.js")
# minified js files should not be passed through jinja renderer
self.assertEqual("//{% if title %} {{title}} {% endif %}\nconsole.log('in');", content)
self.assertEqual("""//{% if title %} {{title}} {% endif %}\nconsole.log("in");\n""", content)
content = get_response_content("/_test/assets/css_asset.css")
self.assertEqual("""body{color:red}""", content)