def get_seller_product(account): """ Get the solitude seller_product for a payment account object. """ bango_product = client.api.bango.product(uri_to_pk(account.product_uri)).get_object_or_404() # TODO(Kumar): we can optimize this by storing the seller_product # when we create it in developers/models.py or allowing solitude # to filter on both fields. return client.api.generic.product(uri_to_pk(bango_product["seller_product"])).get_object_or_404()
def get_seller_product(account): """ Get the solitude seller_product for a payment account object. """ bango_product = (client.api.bango.product(uri_to_pk( account.product_uri)).get_object_or_404()) # TODO(Kumar): we can optimize this by storing the seller_product # when we create it in developers/models.py or allowing solitude # to filter on both fields. return (client.api.generic.product( uri_to_pk(bango_product['seller_product'])).get_object_or_404())
def test_show_secret(self, solitude): self.set_mocks(solitude) resp = self.client.get(self.url) eq_(resp.content, 'shhh!') pk = uri_to_pk(self.account.product_uri) solitude.api.bango.product.assert_called_with(pk) solitude.api.generic.product.assert_called_with('prod-pk')