Пример #1
0
 def setup(self):
     # use a context manager to ensure these settings are
     # only used here
     with override_settings(WAGTAILTRANS_SYNC_TREE=True, WAGTAILTRANS_LANGUAGES_PER_SITE=True):
         register_signal_handlers()
         self.site = sites.SiteFactory()
         SiteLanguages.for_site(self.site)
         self.default_language = Language.objects.get(code='en')
         self.site.sitelanguages.default_language = self.default_language
         pages = sites.create_site_tree(language=self.default_language, site=self.site)
         self.last_page = pages[-1]
Пример #2
0
 def ready(self):
     from wagtailtrans.signals import register_signal_handlers
     register_signal_handlers()