-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
test: Add tests for notification helper functions #6863
Conversation
test_session = SessionFactory() | ||
link = common.url_ | ||
event_name = common.string_ | ||
current_app.config['TESTING'] = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Black would make changes.
send_notif_session_accept_reject, | ||
send_notif_ticket_purchase_organizer, | ||
) | ||
from app.api.helpers.db import save_to_db |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'app.api.helpers.db.save_to_db' imported but unused
@@ -0,0 +1,148 @@ | |||
import unittest | |||
from app.models import db |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'app.models.db' imported but unused
Codecov Report
@@ Coverage Diff @@
## development #6863 +/- ##
===============================================
+ Coverage 66.38% 66.94% +0.55%
===============================================
Files 313 314 +1
Lines 15360 15423 +63
===============================================
+ Hits 10197 10325 +128
+ Misses 5163 5098 -65
Continue to review full report at Codecov.
|
test_session = SessionFactory() | ||
link = common.url_ | ||
event_name = common.string_ | ||
current_app.config['TESTING'] = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the send_notification isn't storing in db when app config is in TESTING mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then find the reason
user, invoice_id, order_url, event_name, subject_id | ||
) | ||
notif_ = Notification.query.all() | ||
self.assertIsNotNone(notif_[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All tests should test the actual content of the notification as well
@diru1100 Update? |
Complexity increasing per file
==============================
- tests/all/integration/api/helpers/test_notification.py 2
See the complete overview on Codacy |
Fixes #6828
Part of #5320
Short description of what this resolves:
Increases test coverage by adding tests for notification helpers functions
Changes proposed in this pull request:
Checklist
development
branch.