Example #1
0
    def test_managepy_cmd(self):
        """Test running a non-interactive manage.py command on a bundle."""

        # first ensure bundle has been deployed
        self.install_my_bundle()

        # now check to see that we can run commands
        diffsettings = deploy.managepy_command(self.app_id,
                                               self.bundle_name,
                                               "diffsettings")
        self.assertTrue(("DATABASE_HOST = '%s'" % self.dbinfo.host)
                        in diffsettings)

        # Ensure "help" command raises a RuntimeError (nonzero exit status)
        try:
            deploy.managepy_command(self.app_id, self.bundle_name, "help")
        except RuntimeError, e:  # expect a RuntimeError as "manage.py help"
                                 # should return nonzero exit status
            self.assertTrue("runserver" in e.message)
            self.assertTrue("Nonzero return code 1 from manage.py help"
                            in e.message)
Example #2
0
def managepy_command(app_id, bundle_name, command,
                     nonzero_exit_ok=False,
                     return_exit_code=False):
    return deploy.managepy_command(app_id, bundle_name, command,
                                   nonzero_exit_ok, return_exit_code)