jleclanche/django-push-notifications — pull request #55 by sudobkz (2014-06-04 16:49:14+00:00)
Title: sudobkz

Hi I am working with Cigna and we needed django-push-notifications to work with python3.4.

There are only 2 functional changes ( 2 one liners ) and the rest are from 'running autopep8 -ria' to convert the code to pep8 standards, which includes replacing tabs with spaces among other things. Someone's editor is putting in tabs which will cause havoc as this project grows.

The python3.4 changes boil down to adding .encode("utf-8") on the end of a string to make it a byte string instead of a 'str'. I can see someone was aware of that but there were a few places that was missing so I put that as close to the exit from this app as possible. _gcm_send() and __apns_pack_frame()

Please upgrade this fix to master if you find this acceptable. We have tested it manually on IOS and Android.

I didnt touch the tests as they appeared to be broken for Python3 before I did anything anyway. I tried but failed to understand why the tests were failing. It looks like the test results are the same, just in a different order because they are dicitonaries which have no order.