def prepare_ch(self, proj_dir, ch_host, ch_port, ch_username, ch_passwd, 
                   om_host, om_port):
        from os.path import dirname
        
        subprocess.call(shlex.split(
            "python %s/manage.py flush --noinput" % proj_dir))
        subprocess.call(shlex.split(
            "python %s/manage.py syncdb --noinput" % proj_dir))
        subprocess.call(shlex.split(
            "python %s/manage.py createsuperuser --noinput "
            "--username=expedient --email=bla@bla.com"  % proj_dir))
        subprocess.call(shlex.split(
            "python %s/manage.py set_fake_passwords"
            " --password=expedient"  % proj_dir))

        browser = Browser()
        browser.login(
            SCHEME+"://%s:%s%s" % (
                ch_host, ch_port, "/accounts/login/"),
            "expedient", "expedient")
        response = browser.get_and_post_form(
            url=SCHEME+"://%s:%s%s" % (
                ch_host, ch_port, "/openflow/aggregate/create/"),
            params=dict(
                name="Test OM",
                description="TestOM Description",
                location="Stanford, CA",
                usage_agreement="Do you agree?",
                username=ch_username,
                password=ch_passwd,
                url=SCHEME+"://%s:%s%s" % (
                    om_host, om_port, "/xmlrpc/xmlrpc/"),
            ),
            del_params=["verify_certs"],
        )
        self.assertTrue(
            response.geturl() == \
                SCHEME+"://%s:%s%s" % (
                    ch_host, ch_port, "/openflow/aggregate/1/links/"),
            "Did not redirect after create correctly. Response was: %s"
            % response.read(),
        )
calculate diffstat and return as a string
dataset/ETHPy150Open fp7-ofelia/ocf/expedient/src/python/plugins/openflow/tests/full/fulltests.py/FullIntegration.prepare_ch--crossover with--dataset/ETHPy150Open ensime/ensime-sublime/patch.py/PatchSet.diffstat