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

Linking Outgoing message in the Database Router with the Database message #448

Merged
merged 1 commit into from Apr 26, 2017
Merged

Linking Outgoing message in the Database Router with the Database message #448

merged 1 commit into from Apr 26, 2017

Conversation

fredcido
Copy link
Contributor

@fredcido fredcido commented Nov 3, 2014

When using Database Router as rapidsms router, at the backend_preparation, link the database message object with the Outgoing message, making possible to retrieve the message saved using the message object.

Now when you use:

from rapidsms import router
...
outgoing_message = router.send('Testing message', connections)
# Now you can get the database messages and transmissions
print outgoing_message.database_message.status
outgoing_message.database_message.transmissions.all()

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) when pulling d243f06 on catalpainternational:feature/database_message into 50292bd on rapidsms:develop.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.006%) to 89.297% when pulling 6dc3b3b on catalpainternational:feature/database_message into bdb3cf4 on rapidsms:develop.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.006%) to 89.297% when pulling 6dc3b3b on catalpainternational:feature/database_message into bdb3cf4 on rapidsms:develop.

@raphaelmerx
Copy link
Contributor

@vkurup Any objections to merging this? Let me know. FYI this would let us ditch our RapidSMS fork living at https://github.com/catalpainternational/rapidsms/

@vkurup
Copy link
Member

vkurup commented Apr 20, 2017

No strong objections, but I'm not very familiar with this section of the code. Would it be possible (and not too difficult) to add a unit test for the new behavior?

Example usage:
```
outgoing_message = router.send('Testing message', connections)
outgoing_message.database_message.transmissions.all()
```
@coveralls
Copy link

Coverage Status

Coverage increased (+0.006%) to 89.297% when pulling 0cd7b15 on catalpainternational:feature/database_message into bdb3cf4 on rapidsms:develop.

@raphaelmerx
Copy link
Contributor

I added test_database_message_sent. It uses the link from rapidsms.messages.outgoing.OutgoingMessage to rapidsms.router.db.models.Message, and checks that the database message has the right properties after being sent.

@vkurup
Copy link
Member

vkurup commented Apr 26, 2017

Excellent, thank you! 🚀

@vkurup vkurup merged commit 992e4c7 into rapidsms:develop Apr 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants