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: removes discrepancies in cancelling order #6186

Merged
merged 1 commit into from Jul 30, 2019

Conversation

shreyanshdwivedi
Copy link
Member

Fixes #6141

Short description of what this resolves:

There are discrepancies while cancelling order.

Changes proposed in this pull request:

  • updates send_notif_ticket_cancel in api/helpers/notification.py
  • updates the logic to raise error on field update in api/orders.py

Checklist

  • I have read the Contribution & Best practices Guide and my PR follows them.
  • My branch is up-to-date with the Upstream development branch.
  • The unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • All the functions created/modified in this PR contain relevant docstrings.

@codecov
Copy link

codecov bot commented Jul 12, 2019

Codecov Report

Merging #6186 into development will decrease coverage by 0.06%.
The diff coverage is 3.57%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development    #6186      +/-   ##
===============================================
- Coverage        65.84%   65.78%   -0.07%     
===============================================
  Files              286      286              
  Lines            14501    14516      +15     
===============================================
+ Hits              9548     9549       +1     
- Misses            4953     4967      +14
Impacted Files Coverage Δ
app/api/helpers/notification.py 21.73% <ø> (ø) ⬆️
app/api/orders.py 29.25% <3.57%> (-1.22%) ⬇️

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 adf81d6...7d18f66. Read the comment docs.

@shreyanshdwivedi
Copy link
Member Author

@iamareebjamal @mrsaicharan1 @uds5501 please review

app/api/orders.py Outdated Show resolved Hide resolved
app/api/orders.py Outdated Show resolved Hide resolved
app/api/orders.py Outdated Show resolved Hide resolved
Copy link
Member

@poush poush left a comment

Choose a reason for hiding this comment

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

Hi, please check my comments. There are more instances of that thing.

app/api/orders.py Outdated Show resolved Hide resolved
app/api/orders.py Outdated Show resolved Hide resolved
app/api/orders.py Outdated Show resolved Hide resolved
app/api/orders.py Outdated Show resolved Hide resolved
app/api/orders.py Outdated Show resolved Hide resolved
app/api/orders.py Outdated Show resolved Hide resolved
app/api/orders.py Outdated Show resolved Hide resolved
app/api/orders.py Outdated Show resolved Hide resolved
app/api/orders.py Outdated Show resolved Hide resolved
app/api/orders.py Outdated Show resolved Hide resolved
@shreyanshdwivedi
Copy link
Member Author

@poush I've updated the PR. Please review

@shreyanshdwivedi
Copy link
Member Author

@iamareebjamal @poush please review

@iamareebjamal
Copy link
Member

Add tests

@shreyanshdwivedi
Copy link
Member Author

Add tests

@iamareebjamal I couldn't find any relevant docs to help me out. Can you please tell me how to add tests for POST or PATCH request? It will help me to add tests for other parts of the project as well

@iamareebjamal
Copy link
Member

https://flask.palletsprojects.com/en/1.1.x/testing/

tests/all/integration/api/test_order.py Outdated Show resolved Hide resolved
tests/all/integration/api/test_order.py Outdated Show resolved Hide resolved
tests/all/integration/api/test_order.py Outdated Show resolved Hide resolved
tests/all/integration/api/test_order.py Outdated Show resolved Hide resolved
tests/all/integration/api/test_order.py Outdated Show resolved Hide resolved
tests/all/integration/api/test_order.py Outdated Show resolved Hide resolved
@fossasia fossasia deleted a comment Jul 25, 2019
@fossasia fossasia deleted a comment Jul 25, 2019
@fossasia fossasia deleted a comment Jul 25, 2019
@fossasia fossasia deleted a comment Jul 25, 2019
@fossasia fossasia deleted a comment Jul 25, 2019
@fossasia fossasia deleted a comment Jul 25, 2019
@fossasia fossasia deleted a comment Jul 25, 2019
@auto-label auto-label bot removed the fix label Jul 25, 2019
@shreyanshdwivedi
Copy link
Member Author

@iamareebjamal I'm unable to add tests and I'm getting confused in adding tests for such API changes. Can you please help me out or should I drop testing it and we can move forward by testing it manually?
@mrsaicharan1 @uds5501 if you've any understanding of adding tests for API changes, can you help me out by adding tests for this?

@iamareebjamal
Copy link
Member

Let's drop tests but thoroughly test for each transition

@shreyanshdwivedi
Copy link
Member Author

shreyanshdwivedi commented Jul 28, 2019

Ok @iamareebjamal
I'll test it again and let you know. Till then placing a DO-NOT-MERGE tag

@shreyanshdwivedi shreyanshdwivedi changed the title [WIP] fix: removes discrepancies in cancelling order fix: removes discrepancies in cancelling order Jul 28, 2019
@auto-label auto-label bot added the fix label Jul 28, 2019
@fossasia fossasia deleted a comment Jul 28, 2019
@shreyanshdwivedi
Copy link
Member Author

@iamareebjamal I've tested the following -

  • Ordered ticket, both placed and pending
  • Cancelled ticket
  • Deleted ticket.

Everything worked fine. @uds5501 @kushthedude @mrsaicharan1 your input will help

@fossasia fossasia deleted a comment Jul 29, 2019
app/api/orders.py Outdated Show resolved Hide resolved
app/api/orders.py Outdated Show resolved Hide resolved
app/api/orders.py Outdated Show resolved Hide resolved
app/api/orders.py Outdated Show resolved Hide resolved
add test

fix hound

fix test

remove tests
@shreyanshdwivedi
Copy link
Member Author

@uds5501 @mrsaicharan1 please review

@fossasia fossasia deleted a comment Jul 30, 2019
@iamareebjamal iamareebjamal merged commit 30cc028 into fossasia:development Jul 30, 2019
mrsaicharan1 pushed a commit to mrsaicharan1/open-event-server that referenced this pull request Aug 9, 2019
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.

Discrepancies in cancelling order
6 participants