Skip to content
This repository has been archived by the owner on Nov 5, 2019. It is now read-only.

django_orm.py: python 3 compatibility #227

Closed
wants to merge 2 commits into from
Closed

Conversation

amezin
Copy link

@amezin amezin commented Jul 31, 2015

Fixes #168 for me. Also, fix FlowField the same way.

@nathanielmanistaatgoogle
Copy link
Contributor

You say "Fixes #168 for me" - how about test coverage so that this change can be said to fix #168 for everyone? :-)

Actually, I think, there should be tests that perform write to
in-memory database, and then read from it. But I have no idea
how to setup full Django environment for it in the test.
@amezin
Copy link
Author

amezin commented Aug 1, 2015

I've added two tests (one for each field class) that check field's metaclass.

But they won't improve coverage. Because problematic lines (__metaclass__ =) were already "covered".

Actually, I think, there should be tests that perform write to temporary (in-memory) database, and then try to read the data back. But I have no idea how to setup necessary Django environment in the test.

@dhermes
Copy link
Contributor

dhermes commented Aug 3, 2015

How would you set up the necessary environment if it wasn't in a test? Maybe we can help you get it working with tox / unittest / nose. FWIW there are probably existing plugins / test harnesses.

@amezin
Copy link
Author

amezin commented Aug 3, 2015

If it wasn't in a test, I'd create a Django project, and run everything (including tests) using django-admin or ./manage.py. All I know is that django does a lot of setup before calling my code. I've found one tool that probably can run django tests as a part of nose test suite: https://pypi.python.org/pypi/NoseDjango. But it haven't been updated for a long time, works only with python 2 and years old versions of django.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"to_python" function not working in class CredentialsField with python3
4 participants