Exemple #1
0
    def test_valid_uninstall(self, wp_generator_specific, wp_plugin_list):

        for plugin_name in ['add-to-any', 'redirection']:

            plugin_config = wp_plugin_list.plugins(TEST_SITE)[plugin_name]
            wp_plugin_config = WPPluginConfig(wp_generator_specific.wp_site, plugin_name, plugin_config)
            wp_plugin_config.uninstall()
            assert wp_plugin_config.is_installed is False
Exemple #2
0
    def test_valid_uninstall(self, wp_generator_category,
                             wp_plugin_list_category):

        for plugin_name in ['add-to-any', 'redirection']:

            plugin_config = wp_plugin_list_category.plugins[plugin_name]
            wp_plugin_config = WPPluginConfig(wp_generator_category.wp_site,
                                              plugin_name, plugin_config)
            wp_plugin_config.uninstall()
            assert wp_plugin_config.is_installed is False
Exemple #3
0
    def test_restore_generic_config(self, wp_generator_generic, wp_plugin_list):

        # First, uninstall from WP installation
        plugin_config = wp_plugin_list.plugins()['add-to-any']
        wp_plugin_config = WPPluginConfig(wp_generator_generic.wp_site, 'add-to-any', plugin_config)
        wp_plugin_config.uninstall()

        # Then, reinstall plugin and configure it
        wp_plugin_config.install()
        wp_plugin_config.configure(force=True)

        # Check plugin options
        wp_config = WPConfig(wp_generator_generic.wp_site)
        assert wp_config.run_wp_cli("option get addtoany_options") == 'test'
Exemple #4
0
    def test_restore_specific_config(self, wp_generator_generic,
                                     wp_plugin_list):

        # First, uninstall from WP installation
        plugin_config = wp_plugin_list.plugins(
            settings.TEST_SITE)['add-to-any']
        wp_plugin_config = WPPluginConfig(wp_generator_generic.wp_site,
                                          'add-to-any', plugin_config)
        wp_plugin_config.uninstall()

        # Then, reinstall and configure it
        wp_plugin_config.install()
        wp_plugin_config.configure()

        # Check plugin options
        wp_config = WPConfig(wp_generator_generic.wp_site)
        assert wp_config.run_wp_cli(
            "option get addtoany_options") == 'test_overload'
        assert wp_config.run_wp_cli("option get addtoany_dummy") == 'dummy'