Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unicode is str in Python3 #887

Merged
merged 2 commits into from Feb 7, 2017
Merged

Conversation

itbabu
Copy link
Contributor

@itbabu itbabu commented Feb 6, 2017

Fix discount error message and add a test

@@ -38,7 +39,7 @@ def clean(self):
discount = voucher.get_discount_for_checkout(self.checkout)
cleaned_data['discount'] = discount
except NotApplicable as e:
self.add_error('voucher', unicode(e))
self.add_error('voucher', six.text_type(e))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use smart_text from django.utils.encoding? That's what we use in rest of the project.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@krzysztofwolski Ok, done.

@codecov-io
Copy link

Codecov Report

Merging #887 into master will increase coverage by 0.02%.

@@            Coverage Diff             @@
##           master     #887      +/-   ##
==========================================
+ Coverage   59.11%   59.14%   +0.02%     
==========================================
  Files         109      109              
  Lines        5944     5945       +1     
  Branches      722      722              
==========================================
+ Hits         3514     3516       +2     
+ Misses       2292     2290       -2     
- Partials      138      139       +1
Impacted Files Coverage Δ
saleor/discount/forms.py 93.33% <100%> (+7.12%)
saleor/core/utils/random_data.py 84.27% <ø> (-0.41%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bb9a841...9a8998f. Read the comment docs.

@krzysztofwolski krzysztofwolski merged commit b7d5075 into saleor:master Feb 7, 2017
@itbabu itbabu deleted the unicode-fix branch February 7, 2017 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants