Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed issue with delegating max_purchase_quantity to wrapper

  • Loading branch information...
commit 5ee416584262c9b2c063c920926fb5fdac769e72 1 parent 7ac85a5
@codeinthehole codeinthehole authored
View
6 oscar/apps/partner/abstract_models.py
@@ -202,11 +202,13 @@ def availability(self):
"""
return get_partner_wrapper(self.partner.name).availability(self)
- def max_purchase_quantity(self, user):
+ def max_purchase_quantity(self, user=None):
"""
Return an item's availability as a string
+
+ :param user: (optional) The user who wants to purchase
"""
- return get_partner_wrapper(self.partner.name).availability(self)
+ return get_partner_wrapper(self.partner.name).max_purchase_quantity(self, user)
@property
def dispatch_date(self):
View
3  oscar/apps/partner/tests/models.py
@@ -58,6 +58,9 @@ def test_cancelling_allocation_ignores_too_big_allocations(self):
self.assertEqual(0, self.stockrecord.num_allocated)
self.assertEqual(10, self.stockrecord.num_in_stock)
+ def test_max_purchase_quantity(self):
+ self.assertEqual(10, self.stockrecord.max_purchase_quantity())
+
class DefaultWrapperTests(TestCase):
Please sign in to comment.
Something went wrong with that request. Please try again.