Ran
|
Files
325
|
Run time
2min
|
Badge
Embed ▾
README BADGES
|
push
travis-ci
Streamline Benefit and Condition name and description handling This commit was triggered by a recursion problem mentioned here: https://github.com/tangentlabs/django-oscar/commit/8199da210#commitcomment-7387486 It now unifies handling for name and description across both conditions and benefits: * Declaring a name property is required for any proxy class. A few classes had a description declared, but no name. But given that the description is the more verbose version, and is allowed to include HTML, it makes sense to still require a name. The declared descriptions in the models that only had one property are better suited for @name anyway. * It drops the max_unaffected_items logic for Benefits. That was only applied if calling via the non-proxy class, and feels more like it should be a description anyway. * __str__ always returns self.name. Anything more complex with that means we might run into problems with the python_2_unicode_compatible decorator. I also added tests for the changes, and verified the tests fail without my changes.
11266 of 14743 relevant lines covered (76.42%)
0.76 hits per line
Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
---|