File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 33
44from  . import  test_crawl 
55from  . import  test_new_page_templates 
6+ from  . import  test_theme_standalone 
67from  . import  test_theme_upgrade 
Original file line number Diff line number Diff line change 11# -*- coding: utf-8 -*- 
22# Part of Odoo. See LICENSE file for full copyright and licensing details. 
33
4+ from  odoo .addons .website .tools  import  MockRequest 
45from  odoo .tests  import  standalone 
56
67
8+ @standalone ('website_standalone' ) 
9+ def  test_01_theme_install_generate_primary_templates (env ):
10+     """ This test ensures the theme `_generate_primary_snippet_templates()` 
11+     method is correctly called before xml views are generated. 
12+     """ 
13+     # 1. Setup 
14+     theme_buzzy  =  env .ref ('base.module_theme_clean' )
15+ 
16+     if  theme_buzzy .state  ==  'installed' :
17+         theme_buzzy .button_immediate_uninstall ()
18+     # Ensure those views are deleted to mimic the initial state of theme not installed. 
19+     # Because "theme_buzzy" was installed before through "test_themes" dependencies, removing 
20+     # those views is needed to replicate the bug: if the configurator views are not generated, 
21+     # the theme install will fail because some of the imported views inherit them. 
22+     env ['ir.ui.view' ].with_context (_force_unlink = True ).search ([('key' , '=' , 'website.configurator_s_banner' )]).unlink ()
23+     env ['ir.ui.view' ].with_context (_force_unlink = True ).search ([('key' , '=' , 'website.configurator_s_cover' )]).unlink ()
24+     theme_buzzy .button_immediate_install ()
25+ 
726@standalone ('website_standalone' ) 
827def  test_02_theme_default_generate_primary_templates (env ):
928    # Verify that theme default's configurator templates are created 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments