David Winterbottom
2b94a8fc1e
Rework how addresses are cleaned
Plus reorganise tests
пре 12 година
Izidor Matušov
019598deab
Validate postcodes based on the country
Validation is based on wikipedia list of postal codes [1]. Formats were
converted into regexes for countries.
1: http://en.wikipedia.org/wiki/List_of_postal_codes
Fixes #753
пре 12 година
Izidor Matušov
405d927787
Shipping offers with zero discount are not included
Fixes #745
пре 12 година
David Winterbottom
a9f7622e1b
Fix Django 1.5 tests caused by using wrong User model
пре 12 година
Izidor Matušov
0a8fada6f6
Fix wrong index used in FixedPriceBenefit
Bad index in `last_line = covered_lines[-1][1]` (previously [-1][0])
caused rounding error. When you have 3 products for £7 and benefit 3
things per £20, each product would get discount £0.33 which doesn't sum
up to £1. The existing code handles this but bad indexing makes it fail.
A test case reproducing the issue was added.
Fixes #742
пре 12 година
David Winterbottom
e462f04fd2
Ensure user addresses are unique per user
This change adds a uniqueness constraint on user addresses to prevent
duplicates. A few changes follow:
- The user address forms in account and checkout are modified to take a
user as a constructor arg so uniqueness can be checked.
- The assignment of a user when creating a new address has been moved
into the form.
пре 12 година
David Winterbottom
40c79bec07
Moar unit tests for the UserAddress model
Also I moved the generate_hash fn up to the Address superclass as it's
possible that it might be used in other Address classes.
пре 12 година
st4lk
e9e1ffeee7
Add 'parent' argument to category_tree template tag
If parent is given, only parent descendant categories will be returned.
Fixes #741
пре 12 година
David Winterbottom
f13df6ff65
Reorganise address tests
пре 12 година
Matus Moravcik
a1a6c602f5
Use get_product_class where possible
пре 12 година
David Winterbottom
4f3f2756cb
Rework the shipping event testing methods
пре 12 година
David Winterbottom
eb74742ec2
Introduce payment event subtotal calculation
пре 12 година
David Winterbottom
11930636c7
Rework shipping event validation
пре 12 година
David Winterbottom
0f81a0245c
Enhance order dashboard
- Add more links
- Add event details to line detail page
пре 12 година
David Winterbottom
441f9ffc1b
Update bankcard model
пре 12 година
David Winterbottom
9d65dbb841
Load User model from compatibility layer
пре 12 година
David Winterbottom
4337a27505
Fix two testing issues arising in Django 1.5
пре 12 година
Maik Hoepfel
8f9d5db31f
Move django-oscar-testsupport into oscar.test
This allows updating code in both places, if necessary. Getting Django
1.5 support would be painful otherwise. This also removes the circular
dependency of django-oscar-testsupport on Oscar.
The requirements were merged. The imports were updated
accordingly. Unused imports in the touched files were removed. No
further changes.
пре 12 година
David Winterbottom
1b5adc86d1
Add integration test for ExtendedURLField
пре 13 година
David Winterbottom
0aed77500a
Rework ExtendedURLValidator and tests
* Tidy implementation of validator
* Tests improved and moved to tests/integration (as they call resolve
internally)
пре 13 година
David Winterbottom
f9799d5029
Reorganise payment tests
пре 12 година
David Winterbottom
51e188f37b
Reclassify order tests as integration tests
As they save stuff...
пре 12 година
David Winterbottom
94b30023bf
Ensure value exists in clean method for AbsoluteDiscount benefits
Without a value, applying an AbsoluteBenefit raises a TypeError.
Fixes #670
пре 12 година
David Winterbottom
220687be5a
Extend email auth backend to handle duplicate emails
The auth backend now gracefully handles situations where there are users
with the same email address.
пре 12 година
David Winterbottom
80384a4007
Fix logic error in product availability
Introduced in 7fd62f2af0 .
пре 12 година
David Winterbottom
a2eb319c07
Alter how absolute discounts are applied
This change applies the discount to all matching lines in the benefit
range, weighting the discount by the line prices. The old way was to
iterate over each line and try and apply all the discount.
This new way means that applying an absolute benefit consumes more
products from the basket than the old way, which may possibly have some
confusing side-effects.
This change avoids an issue where customers can get a free product if
they return most of the ordered products apart from the one that was
discounted to zero.
пре 13 година
David Winterbottom
32dcca2971
Add ability to track the post-order action message
пре 13 година
David Winterbottom
cde35cdf9d
Fix issue with shipping discount not being recorded correctly
пре 13 година
David Winterbottom
7130f7c98c
OrderDiscount instance now created correctly for shipping offers
пре 13 година
David Winterbottom
27b1980bdd
Alter the way shipping discounts are handled
They aren't treated specially any more. They become part of the
'applications' collection rather than being attached to the basket.
пре 13 година
David Winterbottom
7a49678fd3
Add support for showing a custom message on basket page
пре 13 година
David Winterbottom
f9c6c052a2
Rework offer benefits to return result object
This paves the way for custom benefits to return successful applications
that don't lead to a discount.
пре 13 година
David Winterbottom
aa7f899c51
Move catalogue tests to integration folder...
...as they are all integration tests (they save stuff).
пре 13 година
David Winterbottom
aab093deea
Convert non-ASCII char to ASCII for category slugs
This uses the unidecode package to convert non-ASCII words to ASCII
equivalents. We use a new slugify function to wrap this logic as we
will want to use it elsewhere.
See this StackOverflow thread for context:
http://stackoverflow.com/questions/702337/how-to-make-django-slugify-work-properly-with-unicode-strings/
Unidecode becomes a new dependency for Oscar.
https://pypi.python.org/pypi/Unidecode
Hat-tip to @avsazonov for suggesting this fix.
пре 13 година
David Winterbottom
fc9999e70b
Rework subtree updating after move
New impl is considerably simpler and lets the save method update each
node's slug and full name.
пре 13 година
David Winterbottom
5ba13b2330
Add test scaffolding around Category class
пре 13 година
David Winterbottom
8e4d5edd95
Move category tests to integration folder
They use the DB so they are not really unit tests.
пре 13 година
David Winterbottom
1573989b53
Add a status field to offers
This makes it more efficient to load offers now that we can't simply use
the date filters to exlucde unavailable offers.
The is_active field has been reworked to depend on the
get_max_applications method.
The save method of ConditionalOffer now auto-sets status.
Fixes #403
пре 13 година
David Winterbottom
e5d78436e2
Split offer tests into unit/integration folders
This might be futile.
пре 13 година
David Winterbottom
ae13037e48
Turns out there are empty strings being passed to the currency filter
So we add handling to the filter where we check the value can be
converted to a valid decimal. If not, return an empty string.
Fixes #316
пре 13 година
David Winterbottom
0badc8849b
Add integration test for currency templatetag
Plus fix a bug when handling None.
пре 13 година