#579: ProductizedHref fails for dicts as first argument ---------------------------+----------------------- Reporter: olemis | Owner: rjollos Type: defect | Status: review Priority: major | Milestone: Release 7 Component: multiproduct | Version: Resolution: | Keywords: web href ---------------------------+----------------------- Changes (by rjollos):
* owner: => rjollos Comment: I'm having trouble understanding how `ProductizedHref` should behave, and it's only used in two places so I've not had much success inferring the behavior. The only places I see it used are: {{{ bloodhound/bloodhound_dashboard/bhdashboard/widgets/product.py: href = ProductizedHref(self.env, penv.href.base) bloodhound/bloodhound_multiproduct/multiproduct/hooks.py: self.href = ProductizedHref(env.parent.href, env.href.base) bloodhound/bloodhound_multiproduct/multiproduct/hooks.py: self.abs_href = ProductizedHref(env.parent.abs_href, }}} The use in `product.py` seems incorrect (passing an `Environment` object as the first argument rather than an `Href` argument), but it looks like you've already fixed that in #552. What is the expected output from your test case. I have guessed it should be `'/x/y/z?a=1&c=3&b=2`, but that's not what I'm seeing after writing a test case. You'll see that I've done two things: * Added a unit test to test the correct behavior and also document the intended behavior. * Modified the patch to first check that the first argument is a string before performing the other checks that depend on the first argument being a string. ---- (In [1503454]) Added a failing test case for `Href` contract violation. Refs #579. (In [1503456]) Fix for `ProductizedHref` throwing an exception when a dictionary is the first argument. Refs #579. -- Ticket URL: <https://issues.apache.org/bloodhound/ticket/579#comment:5> Apache Bloodhound <https://issues.apache.org/bloodhound/> The Apache Bloodhound issue tracker