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

fix: Discount code quantity calculation #6878

Merged
merged 4 commits into from
Mar 7, 2020

Conversation

iamareebjamal
Copy link
Member

@iamareebjamal iamareebjamal commented Mar 7, 2020

Fixes #6879


db.session.commit()

# Attendees associated with the order without discount code should not be counted

Choose a reason for hiding this comment

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

line too long (93 > 90 characters)

discount_code = DiscountCodeTicketFactory(tickets_number=5)
discount_code.tickets.append(ticket)

order_without_discount = OrderFactory(status='completed')

Choose a reason for hiding this comment

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

Black would make changes.

from app.factories.discount_code import DiscountCodeTicketFactory
from app.models import db

from app.models.discount_code import DiscountCode

Choose a reason for hiding this comment

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

'app.models.discount_code.DiscountCode' imported but unused

@@ -0,0 +1,53 @@
from app.api.helpers.ticketing import TicketingManager
from app.factories.attendee import AttendeeFactory, AttendeeFactoryBase

Choose a reason for hiding this comment

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

'app.factories.attendee.AttendeeFactory' imported but unused

@auto-label auto-label bot added the fix label Mar 7, 2020
@codecov
Copy link

codecov bot commented Mar 7, 2020

Codecov Report

Merging #6878 into development will increase coverage by 0.13%.
The diff coverage is 97.05%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development    #6878      +/-   ##
===============================================
+ Coverage        66.21%   66.34%   +0.13%     
===============================================
  Files              307      308       +1     
  Lines            15298    15330      +32     
===============================================
+ Hits             10129    10171      +42     
+ Misses            5169     5159      -10
Impacted Files Coverage Δ
app/factories/discount_code.py 100% <100%> (ø) ⬆️
app/api/helpers/ticketing.py 24.13% <100%> (+7.33%) ⬆️
...ests/all/integration/api/helpers/test_ticketing.py 100% <100%> (ø)
app/models/discount_code.py 91.52% <88.88%> (-0.48%) ⬇️
app/api/attendees.py 41.17% <0%> (ø) ⬆️
tests/all/integration/api/helpers/test_order.py 98.48% <0%> (+0.09%) ⬆️

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 67d41a1...dd6c8d4. Read the comment docs.

@niranjan94
Copy link
Member

Codacy Here is an overview of what got changed by this pull request:

Complexity increasing per file
==============================
- tests/all/integration/api/helpers/test_ticketing.py  2
         

See the complete overview on Codacy

@iamareebjamal iamareebjamal merged commit f0bbec4 into fossasia:development Mar 7, 2020
@iamareebjamal iamareebjamal deleted the discount branch March 7, 2020 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Discount code quantity calculation logic is completely wrong
3 participants