-
Notifications
You must be signed in to change notification settings - Fork 430
Issue #142: CredentialField Python 3 fix #316
Issue #142: CredentialField Python 3 fix #316
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I signed it! |
CLAs look good, thanks! |
@nathanielmanistaatgoogle Here are the docs for https://docs.djangoproject.com/en/1.8/ref/utils/#django.utils.encoding.smart_bytes (behaves like our |
Also worth noting this fixes the Python3 issues with metaclasses, previously attempted in #227 and it looks like this fixes #168 (in addition to #142, where the conversation with @szopu started). @nathanielmanistaatgoogle Should we also have him fix |
|
||
def get_db_prep_value(self, value, connection, prepared=False): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
8e56fda
to
35fcc85
Compare
35fcc85
to
b6bb23f
Compare
@dhermes Done. Added the docstring & additonal tests. I decided that low-level testing of |
self.assertEqual(_to_bytes(prep_value), self.pickle) | ||
|
||
|
||
class TestCredentialsFieldViaModel(unittest.TestCase): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This LGTM @nathanielmanistaatgoogle are we a go to merge this? After merging, someone (I can do it) needs to update |
Looks mergeable to me; thank you for leading review! |
Issue #142: CredentialField Python 3 fix
Thanks @szopu ! |
This PR should fix issue #142.
Changes
oauth2client.django_orm.CredentialsField
:get_prep_value
instead ofget_db_prep_value
value_to_string
methodget_prep_value
,to_python
(required by Python 3)test_django_orm
tests: