def run(): from .utils.generate_screenshot_test_report import get_screenshot_test_base_folder # clean screenshots from last run rmtree(str(get_screenshot_test_base_folder()), ignore_errors=True) # run test and generate new screenshots from app_helper import runner runner.cms("djangocms_equation")
def test_runner_cms_exception(self): try: import cms raise unittest.SkipTest("django CMS available, skipping test") except ImportError: pass from app_helper.test_utils.runners import CapturedOutputRunner with patch("django.test.runner.DiscoverRunner", CapturedOutputRunner): with work_in(self.basedir): with captured_output() as (out, err): with self.assertRaises(ImportError) as exit: args = list() args.append("helper") runner.cms("example1", args)
def test_runner_compat(self): try: import cms except ImportError: raise unittest.SkipTest("django CMS not available, skipping test") from app_helper.test_utils.runners import CapturedOutputRunner with patch("django.test.runner.DiscoverRunner", CapturedOutputRunner): with work_in(self.basedir): with captured_output() as (out, err): with self.assertRaises(SystemExit) as exit: args = list() args.append("cms_helper") args.append("test") args.append("example1") runner.cms("example1", args) self.assertTrue("visible string" in out.getvalue()) self.assertFalse("hidden string" in out.getvalue()) self.assertFalse("hidden string" in err.getvalue()) self.assertTrue("Ran 14 tests in" in err.getvalue()) self.assertEqual(exit.exception.code, 0)
def test_runner_wrong(self): try: import cms except ImportError: raise unittest.SkipTest("django CMS not available, skipping test") with work_in(self.basedir): if sys.version_info < (3, 5): exception = ImportError else: exception = SystemExit with captured_output() as (out, err): with self.assertRaises(exception) as exit: args = list() args.append("helper") args.append("test") args.append("example1") args.append("--runner=runners.CapturedOutputRunner") args.append("whatever") runner.cms("example1", args) if sys.version_info >= (3, 5): self.assertEqual(exit.exception.code, 1)
def test_runner_cms_argv(self): try: import cms except ImportError: raise unittest.SkipTest("django CMS not available, skipping test") def fake_runner(argv): return argv from app_helper.test_utils.runners import CapturedOutputRunner with patch("django.test.runner.DiscoverRunner", CapturedOutputRunner): with work_in(self.basedir): with captured_output() as (out, err): args = list() args.append("helper") with patch("app_helper.runner.runner", fake_runner): data = runner.cms("example1", args) self.assertEqual(data, ["helper", "example1", "test", "--cms"])
def run(): from app_helper import runner runner.cms("djangocms_versioning", extra_args=[])
def run(): from app_helper import runner runner.cms('djangocms_modules')
def run(): from app_helper import runner runner.cms('djangocms_version_locking', extra_args=[])
def run(): from app_helper import runner runner.cms('djangocms_admin_style')
def run(): from app_helper import runner runner.cms("djangocms_blog")
def run(): from app_helper import runner runner.cms('djangocms_history')
def run(): from app_helper import runner runner.cms('djangocms_bootstrap4')
def run(): from app_helper import runner runner.cms('djangocms_apphook_setup')
def run(): from app_helper import runner runner.cms('djangocms_versioning_filer', extra_args=[])
def run(): from app_helper import runner runner.cms("djangocms_navigation", extra_args=[])
def run(): from app_helper import runner runner.cms('djangocms_alias', extra_args=[])
def run(): from app_helper import runner runner.cms('djangocms_picture')
def run(): from app_helper import runner runner.cms('djangocms_semantic_ui')
def run(): from app_helper import runner runner.cms('djangocms_page_meta')
def run(): from app_helper import runner runner.cms('djangocms_redirect')
def run(): from app_helper import runner runner.cms('djangocms_page_sitemap')
def run(): from app_helper import runner runner.cms('cmsplugin_plain_text')
def run(): from app_helper import runner runner.cms('aldryn_django_cms')
def run(): from app_helper import runner runner.cms('djangocms_video')
def run(): from app_helper import runner runner.cms('djangocms_transfer')
def run(): from app_helper import runner runner.cms("example1")
def run(): from app_helper import runner runner.cms('djangocms_attributes_field')
def test(): from app_helper import runner runner.cms('djangocms_text_ckeditor')
def run(): from app_helper import runner runner.cms('djangocms_file')
def run(): from app_helper import runner runner.cms('djangocms_timed')