Esempio n. 1
0
 def test_runner_nocms(self):
     with work_in(self.basedir):
         with captured_output() as (out, err):
             with self.assertRaises(SystemExit) as exit:
                 args = list()
                 args.append("helper")
                 args.append("example1")
                 args.append("test")
                 args.append("--extra-settings=helper.py")
                 args.append("--runner=runners.CapturedOutputRunner")
                 runner.run("example1", args)
     self.assertTrue("Ran 14 tests in" in err.getvalue())
     self.assertEqual(exit.exception.code, 0)
Esempio n. 2
0
 def test_runner_pytest(self):
     with work_in(self.basedir):
         with captured_output() as (out, err):
             with self.assertRaises(SystemExit) as exit:
                 args = list()
                 args.append("helper_no_cms")
                 args.append("example1")
                 args.append("test")
                 args.append("--extra-settings=helper_no_cms.py")
                 args.append(
                     "--runner=app_helper.pytest_runner.PytestTestRunner")
                 runner.run("example1", args)
     self.assertTrue("collected 15 items" in out.getvalue())
     # warnings will depend on django version and adds too much noise
     self.assertTrue("10 passed, 5 skipped" in out.getvalue())
     self.assertEqual(exit.exception.code, 0)
Esempio n. 3
0
    def test_runner_argv(self):
        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.run("example1", args)
                    self.assertEqual(data, ["helper", "example1", "test"])
Esempio n. 4
0
def run():
    from app_helper import runner
    runner.run('filer')
Esempio n. 5
0
def run():
    from app_helper import runner
    runner.run('meta')
Esempio n. 6
0
def run():
    from app_helper import runner
    runner.run('aldryn_django')
Esempio n. 7
0
def run():
    from app_helper import runner
    runner.run('django_frontify')
Esempio n. 8
0
def run():
    from app_helper import runner
    runner.run('knocker')