def with_comprehensive_theme(theme_dir_name):
 def _decorator(func):
  @wraps(func)
  def _decorated(*args, **kwargs):
   domain = '{theme_dir_name}.org'.format(theme_dir_name=re.sub('\\.org$', '', theme_dir_name))
   (site, __) = Site.objects.get_or_create(domain=domain, name=domain)
   (site_theme, __) = SiteTheme.objects.get_or_create(site=site, theme_dir_name=theme_dir_name)
   with patch('openedx.core.djangoapps.theming.helpers.get_current_site_theme', return_value=site_theme):
    with patch('openedx.core.djangoapps.theming.helpers.get_current_site', return_value=site):
     return func(*args, **kwargs)
  return _decorated
 return _decorator

def with_comprehensive_theme ( theme_dir_name ) : def _decorator ( func ) : @ wraps ( func ) def _decorated ( * args , ** kwargs ) : domain = '{theme_dir_name}.org' . format ( theme_dir_name = re . sub ( '\\.org$' , '' , theme_dir_name ) ) ( site , __ ) = Site . objects . get_or_create ( domain = domain , name = domain ) ( site_theme , __ ) = SiteTheme . objects . get_or_create ( site = site , theme_dir_name = theme_dir_name ) with patch ( 'openedx.core.djangoapps.theming.helpers.get_current_site_theme' , return_value = site_theme ) : with patch ( 'openedx.core.djangoapps.theming.helpers.get_current_site' , return_value = site ) : return func ( * args , ** kwargs ) return _decorated return _decorator
a decorator to run a test with a comprehensive theming enabled .