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

chore: Enable dredd tests for some of the Orders API endpoints #7261

Merged
merged 2 commits into from
Sep 12, 2020
Merged

chore: Enable dredd tests for some of the Orders API endpoints #7261

merged 2 commits into from
Sep 12, 2020

Conversation

blossom2017
Copy link
Contributor

@blossom2017 blossom2017 commented Sep 11, 2020

#7014
#7005

Short description of what this resolves:

Adds dredd tests for Orders API that were being skipped

Changes proposed in this pull request:

  • Updates orders.apib

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.

discount_code = DiscountCodeTicketSubFactory(
type='percent', value=10.0, tickets=[]
)
tickets_dict = _create_taxed_tickets(

Choose a reason for hiding this comment

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

local variable 'tickets_dict' is assigned to but never used

from tests.factories.faq_type import FaqTypeFactory
from tests.factories.user_email import UserEmailFactory
from tests.factories.feedback import FeedbackFactory
from tests.factories.service import ServiceFactory
from tests.factories.message_setting import MessageSettingsFactory
from tests.factories.user_favourite_events import UserFavouriteEventFactory
from tests.factories.discount_code import DiscountCodeTicketSubFactory

from tests.all.integration.api.helpers.order.test_calculate_order_amount import (

Choose a reason for hiding this comment

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

module level import not at top of file

@blossom2017 blossom2017 changed the title Enables dredd tests for some of the Orders api endpoints. [WIP] Enables dredd tests for some of the Orders api endpoints. Sep 11, 2020
@@ -167,7 +167,7 @@ def create_order():
db.session.commit()
order.populate_and_save()

return OrderSchema().dumps(order)
return OrderSchema().dump(order)
Copy link
Member

Choose a reason for hiding this comment

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

Why dump instead of dumps?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

dumps was returning a string -> content/html whereas dump returned dictionary application/json. I saw that in the other places dump had been used.

@@ -793,3 +626,114 @@ Create paypal payment
"payment_id": "example",
"error": null
}

## Create Order [/v1/orders/create-order]
Copy link
Member

Choose a reason for hiding this comment

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

This should be placed in create order (1st section) place

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@@ -33,7 +33,11 @@
from tests.factories.event_copyright import EventCopyrightFactory
from tests.factories.setting import SettingFactory
from tests.factories.event_type import EventTypeFactory
from tests.factories.discount_code import DiscountCodeFactory, DiscountCodeTicketFactory
from tests.factories.discount_code import (

Choose a reason for hiding this comment

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

module level import not at top of file

@codecov
Copy link

codecov bot commented Sep 12, 2020

Codecov Report

Merging #7261 into development will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##           development    #7261   +/-   ##
============================================
  Coverage        63.55%   63.55%           
============================================
  Files              259      259           
  Lines            13034    13034           
============================================
  Hits              8284     8284           
  Misses            4750     4750           
Impacted Files Coverage Δ
app/api/custom/orders.py 36.99% <100.00%> (ø)

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 c3912fd...d8982a2. Read the comment docs.

@blossom2017 blossom2017 changed the title [WIP] Enables dredd tests for some of the Orders api endpoints. Enables dredd tests for some of the Orders api endpoints. Sep 12, 2020
@iamareebjamal iamareebjamal changed the title Enables dredd tests for some of the Orders api endpoints. chore: Enables dredd tests for some of the Orders api endpoints. Sep 12, 2020
@auto-label auto-label bot added the chore label Sep 12, 2020
@iamareebjamal iamareebjamal changed the title chore: Enables dredd tests for some of the Orders api endpoints. chore: Enable dredd tests for some of the Orders API endpoints Sep 12, 2020
@iamareebjamal iamareebjamal merged commit b872fe2 into fossasia:development Sep 12, 2020
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.

3 participants