@contextmanager
def override_current_theme_class(theme_class=_not_set):
 global _current_theme_class
 from shuup.xtheme.views.extra import clear_view_cache
 old_theme_class = _current_theme_class
 _current_theme_class = theme_class
 clear_view_cache()
 (yield)
 _current_theme_class = old_theme_class
 clear_view_cache()

@ contextmanager def override_current_theme_class ( theme_class = _not_set ) : global _current_theme_class from shuup . xtheme . views . extra import clear_view_cache old_theme_class = _current_theme_class _current_theme_class = theme_class clear_view_cache ( ) ( yield ) _current_theme_class = old_theme_class clear_view_cache ( )
context manager for overriding the currently active theme class for testing .