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

Add a non regression test to deal with buffer types #125

Merged
merged 2 commits into from Mar 24, 2018

Conversation

hsmett
Copy link
Contributor

@hsmett hsmett commented Mar 1, 2018

Python 2.7:

>>> str(buffer(b"I'm binary"))
"I'm binary"
>>> bytes(buffer(b"I'm binary"))
"I'm binary"

Python 3.6:

>>> str(memoryview(b"I'm binary"))
'<memory at 0x7fd84fc27648>'
>>> bytes(memoryview(b"I'm binary"))
b"I'm binary"

@coveralls
Copy link

Coverage Status

Coverage increased (+0.4%) to 95.926% when pulling 4a343d6595325e5060e5893a97b5bff613508494 on hsmett:hsmett/binaries into e1d1de0 on romgar:develop.

@coveralls
Copy link

coveralls commented Mar 1, 2018

Coverage Status

Coverage increased (+0.4%) to 95.926% when pulling 14cfab0 on hsmett:hsmett/binaries into d4569cb on romgar:develop.


@pytest.mark.django_db
def test_bytea():
TestBinaryModel.objects.create(bytea=b64encode(b'Hello'))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this b64encode?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not intended, thanks for noticing.

@hsmett
Copy link
Contributor Author

hsmett commented Mar 7, 2018

Done :)

@romgar romgar merged commit 590f998 into romgar:develop Mar 24, 2018
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

3 participants