-
Notifications
You must be signed in to change notification settings - Fork 61
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
feat(phone_verify): Add Kavenegar backend #34
base: master
Are you sure you want to change the base?
feat(phone_verify): Add Kavenegar backend #34
Conversation
@CuriousLearner |
8575df1
to
de56ea4
Compare
I've increased test coverage by mocking top layer of send message functions that is clients like: |
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.
Thanks for your work!
I've just a few minor comments and we'll be good to go!
💯
Once you're done with the changes, can you please let me know how can I test the Kavenegar API locally? |
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.
Once you're done with the changes, can you please let me know how can I test the Kavenegar API locally?
There is its documentation:
https://github.com/kavenegar/kavenegar-python
Hi @CuriousLearner
|
phone_verify/backends/kavenegar.py
Outdated
self.client.sms_send(params) | ||
|
||
def send_bulk_sms(self, numbers, message): | ||
params = {'sender': self.sender, 'receptor': numbers, 'message': message, } |
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 API here states that sender should be a list of strings and you're providing a single sender here 🤔
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.
Can you please have a look at this when you get the time?
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.
Ping @SepehrHasanabadi Can you please have a look at this conversation? Have you tested these changes?
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.
Also, @SepehrHasanabadi, have a look at this comment as well.
Hi @SepehrHasanabadi Yes, the idea was for me to test it, but I don't have a number for that country. I will trust if you can ensure that when you install it in a Django project, this works and you indeed get an SMS :) So, let me know. |
…y into SepehrHasanabadi-kavenegar-api * 'master' of github.com:CuriousLearner/django-phone-verify: chore(deps-dev): Bump django from 2.1.11 to 2.2.10 in /requirements (CuriousLearner#36) fix(backends): Emit `post_save` signal on phone number verification (CuriousLearner#29)
…y into SepehrHasanabadi-kavenegar-api * 'master' of github.com:CuriousLearner/django-phone-verify: fix(phone_verify): Return same number of arguments in the overridden method (CuriousLearner#38)
…y into kavenegar-api
6a0b741
to
c59e927
Compare
…one-verify into kavenegar-api
@SepehrHasanabadi Hello, Is your PR ready to review? |
@CuriousLearner |
@SepehrHasanabadi I think it won't be possible for me to test. But can you integrate the package with a django project and do a test that this backend works? |
* master: tests(*): Increase test coverage to 100% 🔥 (CuriousLearner#46) fix(backends/nexmo): Define exception class (CuriousLearner#45) chore(): Release django-phone-verify 1.1.0
@SepehrHasanabadi I just updated your branch with the latest code that we have. Can you please take a look at the failing tests? Once they pass, please check that you get a message while using this backend. thanks! |
@CuriousLearner |
@SepehrHasanabadi will it make sense to put the condition if the backend is Kavenegar, then test in some other way? Most probably, you'll mock the Kavenegar API you are using for sending bulk_sms. It seems you are doing so, just instead of |
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.
I see you have not added any Sandbox class for the Kavenegar Backend. Will it be possible for you to do so?
phone_verify/backends/kavenegar.py
Outdated
self.client.sms_send(params) | ||
|
||
def send_bulk_sms(self, numbers, message): | ||
params = {'sender': self.sender, 'receptor': numbers, 'message': message, } |
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.
Also, @SepehrHasanabadi, have a look at this comment as well.
Kavenegar is an Iranian sending message platform like twilio.
The backend class is created to send single and bulk messages to iranian sim cards.
Twilio does not support Iranian sim cards due to any reason.