def process_request(self, request): """ Set the request's 'site_theme' """ # TODO: resolve. If the site does not exist, should we create it? or use a placeholder site_id theme_name = ThemingConfiguration.get_theme_name() if theme_name: current_theme = SITE_THEME( site_id=1, theme_dir_name=theme_name, ) current_theme.id = 1 request.site_theme = current_theme
def is_current_theme(self): """ Check if the theme instance is the current tenant theme """ return self.name == ThemingConfiguration.get_theme_name()
def test_get_theme_name_tenant(self): """ Test get_theme_name for microsite v0. """ theme = ThemingConfiguration.get_theme_name() self.assertEqual(theme, 'other-theme')
def test_get_theme_name(self): """ Test get_theme_name function. """ theme = ThemingConfiguration.get_theme_name() self.assertEqual(theme, 'default-theme')