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'
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'