[ADD] theme saas-14.3
This commit is contained in:
@@ -40,10 +40,14 @@
|
||||
'theme_zap',
|
||||
],
|
||||
'data': [
|
||||
'views/assets.xml',
|
||||
'views/website_navbar_templates.xml',
|
||||
],
|
||||
'installable': True,
|
||||
'application': False,
|
||||
'post_init_hook': 'post_init_hook',
|
||||
'assets': {
|
||||
'web.assets_frontend': [
|
||||
'test_themes/static/src/js/navbar.js',
|
||||
],
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,12 +13,23 @@ class Crawler(HttpCase):
|
||||
Website = self.env['website']
|
||||
websites_themes = Website.get_test_themes_websites()
|
||||
assert len(websites_themes) == len(self.env.ref('base.module_test_themes').dependencies_id)
|
||||
websites_themes_names = websites_themes.mapped('name')
|
||||
|
||||
def test_crawling():
|
||||
for website in websites_themes.filtered(lambda w: w.theme_id.name != 'theme_default'):
|
||||
# Ensure theme is rendering without crashing
|
||||
r = self.url_open('/?fw=%s&debug=assets' % website.id)
|
||||
self.assertEqual(r.status_code, 200, "Ensure rendering went fine as public user")
|
||||
self.assertTrue('/%s/static/src' % website.theme_id.name in r.text, "Ensure rendering went fine as public user")
|
||||
self.assertEqual(r.status_code, 200, "Ensure theme is rendering without crashing")
|
||||
|
||||
# Ensure correct theme is actually loaded, see commit message
|
||||
theme_asset_url = '/web/assets/debug/%s/web.assets_frontend.css' % website.id
|
||||
self.assertTrue(theme_asset_url in r.text)
|
||||
r = self.url_open(theme_asset_url)
|
||||
self.assertTrue('/%s/static/src' % website.theme_id.name in r.text, "Ensure theme is actually loaded")
|
||||
# Ensure other website/themes are not loaded
|
||||
for name in websites_themes_names:
|
||||
if name != website.theme_id.name:
|
||||
self.assertFalse('/%s/static/src' % name in r.text, "Ensure other themes do not pollute current one")
|
||||
|
||||
# 1. Test as public user
|
||||
test_crawling()
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<template id="assets_frontend" inherit_id="website.assets_frontend" name="Website Assets">
|
||||
<xpath expr="//script[last()]" position="after">
|
||||
<script type="text/javascript" src="/test_themes/static/src/js/navbar.js"/>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user