Пример #1
0
def setup():
    # clean WP site
    wp_generator = MockedWPGenerator({'openshift_env': OPENSHIFT_ENV, 'wp_site_url': SITE_URL_SPECIFIC})
    wp_generator.clean()
    # clean backups
    backup_path = WPBackup(OPENSHIFT_ENV, SITE_URL_SPECIFIC).path
    shutil.rmtree(backup_path, ignore_errors=True)
Пример #2
0
def wp_generator_specific():
    # To generate website with specific plugin list/configuration
    generator = MockedWPGenerator(settings.OPENSHIFT_ENV,
                                  SITE_URL_SPECIFIC,
                                  wp_default_site_title="My test")
    generator.clean()
    generator.generate()
    return generator
Пример #3
0
 def wp_generator(self):
     generator = MockedWPGenerator(
         settings.OPENSHIFT_ENV,
         "http://localhost/folder",
         wp_default_site_title=self.TITLE_WITH_ACCENT,
         unit_name="idevelop",
         updates_automatic=False)
     generator.clean()
     return generator
Пример #4
0
def wp_generator_generic():
    # To generate website with generic plugin list/configuration
    generator = MockedWPGenerator(settings.OPENSHIFT_ENV,
                                  SITE_URL_GENERIC,
                                  wp_default_site_title="My test",
                                  unit_name='idevelop')
    generator.clean()
    generator.generate()
    return generator
Пример #5
0
 def wp_generator(self):
     generator = MockedWPGenerator({
         'openshift_env': settings.OPENSHIFT_ENV,
         'wp_site_url': "http://localhost/folder",
         'wp_site_title': 'DM',
         'wp_tagline': self.TAGLINE_WITH_ACCENT,
         'unit_name': 'idevelop',
         'updates_automatic': False
     })
     generator.clean()
     return generator
Пример #6
0
 def wp_generator(self):
     generator = MockedWPGenerator(
         OPENSHIFT_ENV,
         "http://" + HTTPD_CONTAINER + "/folder",
         wp_default_site_title="Upload test",
         admin_password="******")
     generator.clean()
     generator.generate()
     command = "option add plugin:epfl_tequila:has_dual_auth 1"
     if not generator.run_wp_cli(command):
         raise ValueError("Could not set option on generated site")
     return generator
Пример #7
0
def wp_generator_specific():
    # To generate website with specific plugin list/configuration
    generator = MockedWPGenerator({
        'openshift_env': settings.OPENSHIFT_ENV,
        'wp_site_url': SITE_URL_SPECIFIC,
        'wp_site_title': "TEST",
        'wp_tagline': "My Test",
        'unit_name': UNIT_NAME
    })
    generator.clean()
    generator.generate()
    return generator
Пример #8
0
def wp_generator_generic():
    # To generate website with generic plugin list/configuration
    generator = MockedWPGenerator({
        'openshift_env': settings.OPENSHIFT_ENV,
        'wp_site_url': SITE_URL_GENERIC,
        'wp_site_title': "TEST",
        'wp_tagline': "My Test",
        'langs': 'en',
        'unit_name': UNIT_NAME,
        'category': settings.DEFAULT_WP_SITE_CATEGORY
    })
    generator.clean()
    generator.generate()
    return generator
Пример #9
0
 def wp_generator(self):
     generator = MockedWPGenerator(
         {
             'openshift_env': OPENSHIFT_ENV,
             'wp_site_url': "https://" + HTTPD_CONTAINER + "/folder",
             'wp_site_title': "UP",
             'wp_tagline': "upload test"
         },
         admin_password="******")
     generator.clean()
     generator.generate()
     command = "option add plugin:epfl_tequila:has_dual_auth 1"
     if not generator.run_wp_cli(command):
         raise ValueError("Could not set option on generated site")
     return generator
Пример #10
0
def setup():
    wp_env = OPENSHIFT_ENV
    wp_url = SITE_URL_SPECIFIC
    wp_generator = MockedWPGenerator(wp_env, wp_url)
    wp_generator.clean()