Пример #1
0
 def test_get_wagtail_page(self):
     create_careers_pages.run()
     self.create_wagtail_careers_feature_flag(enabled=True)
     with patch(
         'transition_utilities.conditional_urls.wagtail_serve'
     ) as wagtail_serve:
         self.request()
         self.assertEqual(wagtail_serve.call_count, 1)
Пример #2
0
    def test_assert_script_keeps_page_content_if_pages_already_exist(self):
        create_careers_pages.run()

        careers = Page.objects.get(slug='careers')
        careers.title = 'test title'
        save_page(careers)

        create_careers_pages.run()

        careers_after_rerun = Page.objects.get(slug='careers')
        self.assertEqual(careers_after_rerun.title, 'test title')
Пример #3
0
 def test_assert_script_can_run_multiple_times(self):
     create_careers_pages.run()
     create_careers_pages.run()
Пример #4
0
 def test_assert_careers_pages_created_by_script(self):
     create_careers_pages.run()
     for slug in self.slugs:
         self.assertTrue(Page.objects.filter(slug=slug).exists())