Commit graph

81 commits

Author SHA1 Message Date
Christopher Neugebauer
2f77f5bb23 Replaces .active = False; .save() pattern in tests with a test controller method 2016-04-06 17:24:25 +10:00
Christopher Neugebauer
8ad265a65a Fixes tests now that $0 invoices pay themselves 2016-04-06 17:19:09 +10:00
Christopher Neugebauer
c8c16072ba fix_simple_errors() now removes exhausted vouchers from the voucher set. 2016-04-06 14:02:23 +10:00
Christopher Neugebauer
0d57da8d6f Makes apply_voucher() idempotent, adds _test_voucher to validate_cart, and updates tests. 2016-04-06 14:02:22 +10:00
Christopher Neugebauer
8d07518a9b Fixes an incorrect voucher test 2016-04-06 14:02:22 +10:00
Christopher Neugebauer
7d97d2d2de Adds fix_simple_errors to cart - it zeroes out unavailable products. Adds test that it does that. 2016-04-06 14:02:22 +10:00
Christopher Neugebauer
f5d9458d1a Adds a validation based on available_products to validate_cart, and a test based on simple enabling conditions 2016-04-06 10:22:44 +10:00
Christopher Neugebauer
7609965883 flake8 compliance 2016-04-03 13:21:57 +10:00
Christopher Neugebauer
4d134e95d7 Refactors discount ceiling testing to make sure that the discount ceiling only considers items where the discount was applied in determining if the discount was reached. 2016-04-03 13:16:35 +10:00
Christopher Neugebauer
eab1deff77 Removes set_quantity and add_to_cart from CartController, and factors it into a test controller for testing 2016-04-03 10:07:59 +10:00
Christopher Neugebauer
2cbda9172f Fixes bug in product and category, and ceiling enabling conditions 2016-04-02 20:31:59 +11:00
Christopher Neugebauer
2e0144effe flake8 2016-04-02 13:29:53 +11:00
Christopher Neugebauer
8f233c7943 available_products now refers to the user’s product limits as well as enabling conditions 2016-04-02 13:14:34 +11:00
Christopher Neugebauer
f7289c2101 Adds ‘available_categories’ as something that actually works 2016-04-02 11:56:03 +11:00
Christopher Neugebauer
12e4d0a3cb flake8 2016-04-01 12:14:39 +01:00
Christopher Neugebauer
cf85af7719 Adds refund function, adds tests, makes sure that refunds are obeyed elsewhere in the codebase 2016-03-27 21:04:10 +11:00
Christopher Neugebauer
3e4e52b165 Adds more constraints around payment and voiding of invoices 2016-03-27 14:41:43 +11:00
Christopher Neugebauer
8080d7851b Invoices now automatically void themselves if their cart is out of date 2016-03-27 14:04:47 +11:00
Christopher Neugebauer
0d458bea06 Allows Product.limit_per_user to be blank and null. Adds Category.limit_per_user. Adds functionality and tests to verify that this is legal. 2016-03-27 13:12:33 +11:00
Christopher Neugebauer
7c99750f3a Simplifies creation of test data in test_cart, adds an extra product category and two new products 2016-03-27 13:12:33 +11:00
Christopher Neugebauer
2d5cd622c5 Makes it invalid for a user to re-enter a voucher code they already have. 2016-03-26 19:47:01 +11:00
Christopher Neugebauer
45aa83f854 Adds available_products as a method on ProductController 2016-03-26 13:37:13 +11:00
Christopher Neugebauer
fb3878ce2e Adds available_discounts, which allows enumeration of the discounts that are available for a given set of products and categories 2016-03-25 18:59:34 +11:00
Christopher Neugebauer
8d66ed5715 Fix flake8 warnings 2016-03-25 14:51:39 +11:00
Christopher Neugebauer
8e6364d02a Fixes bug where discount quantity applied to all users rather than specific user. Adds test case. 2016-03-25 12:50:34 +11:00
Christopher Neugebauer
cc42490832 Applying a voucher to a cart now uses the voucher code rather than the voucher object. Adds tests for constraints on vouchers. 2016-03-23 15:04:51 +11:00
Christopher Neugebauer
0182a32f03 Fixes various errors in discount calculation, and adds tests for these 2016-03-04 18:32:52 -08:00
Christopher Neugebauer
c51be4d30a Adds set_quantity as a method on CartController.
Refactors add_to_cart to be in terms of set_quantity
2016-03-04 14:07:02 -08:00
Christopher Neugebauer
224878a10c Fixes flake8 errors 2016-01-22 17:21:29 +11:00
Christopher Neugebauer
c2400c4695 Moves the controller modules into their own subpackage. There's going to be a lot of stuff in there. 2016-01-22 16:29:41 +11:00
Christopher Neugebauer
d9e433659d Imports code from old Symposion repo 2016-01-22 16:19:11 +11:00