bogdal / django-gcm

Google Cloud Messaging Server in Django
https://django-gcm.readthedocs.org
BSD 2-Clause "Simplified" License
98 stars 42 forks source link

Add a way to test the send_message class of functions #16

Closed tasn closed 10 years ago

tasn commented 10 years ago

This project needs better test coverage in that section, more specifically, all of the handling on the server. Especially error handling, but even success verification.

tasn commented 10 years ago

Now that we have GCMMessage in an api, we probably need a way to be able to set an alternative GCMMessage api on objects/querysets. This will let us use mock api for testing purposes.

It'd also be great to be able to set the GCMMessage of a device class. This will essentially let you do cool stuff like for example, adding iOS support to the same infra in a very simple and consistent manner without having to re-implement things. This essentially means you'd only have to re-implement post_send(), and the rest will remain the same (in the device). Including querysets (once fixed). Now it doesn't look or feel like a lot, but it can grow.

bogdal commented 10 years ago

Right now this package has 100% test coverage. If you want to test some particular scenario feel free to create PR.

tasn commented 10 years ago

How is that possible if the send_message stuff aren't being tested?

I might create one soon. I didn't open this ticket for you, I opened this ticket as a reminder to what's missing and that someone (possibly me, possibly you, possibly someone else) should fix.

Tom. On 1 Sep 2014 23:41, "Adam Bogdał" notifications@github.com wrote:

Right now this package has 100% test coverage. If you want to test some particular scenario feel free to create PR.

— Reply to this email directly or view it on GitHub https://github.com/bogdal/django-gcm/issues/16#issuecomment-54095381.

bogdal commented 10 years ago

Really? Please check again tests.py file.

tasn commented 10 years ago

You cheated! You added those after my last message before you closed it without saying you did and implying it was always there. :)

Anyhow, very good, this is now solved. Thanks a lot.