Explorar el Código

test: fix anticipiated test failures

(cherry picked from commit 015937a03a)
version-14
Ankush Menat hace 2 años
committed by Mergify
padre
commit
c392323015
Se han modificado 2 ficheros con 3 adiciones y 2 borrados
  1. +1
    -0
      .pre-commit-config.yaml
  2. +2
    -2
      frappe/tests/test_website.py

+ 1
- 0
.pre-commit-config.yaml Ver fichero

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


+ 2
- 2
frappe/tests/test_website.py Ver fichero

@@ -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)


Cargando…
Cancelar
Guardar