def test_cross_sell_plugin_with_invalid_type(): plugin = ProductCrossSellsPlugin({"type": "foobar"}) assert plugin.config["type"] == ProductCrossSellType.RELATED plugin.config["type"] = "foobar" context_data = plugin.get_context_data({"request": "REQUEST"}) assert context_data["type"] == ProductCrossSellType.RELATED
def test_cross_sell_plugin_with_invalid_type(): plugin = ProductCrossSellsPlugin({"type": "foobar"}) assert plugin.config['type'] == ProductCrossSellType.RELATED plugin.config['type'] = 'foobar' context_data = plugin.get_context_data({'request': 'REQUEST'}) assert context_data['type'] == ProductCrossSellType.RELATED