paulocheque / django-smart-autoregister

It is a Django tool that automatically configure the ModelAdmin classes of your application using some good patterns
http://paulocheque.github.io/django-smart-autoregister/
Other
28 stars 2 forks source link

django_greater_than() no longer working with Django 1.10 #1

Open lutuh opened 7 years ago

lutuh commented 7 years ago

Hi,

in Django 1.10 the method django_greater_than('1.7') returns False because the DJANGO_VERSION results to 1.1 due to that slice [0:3].

I'm happy to provide a pull request for this bug. I've already checked the Pull Request tips located here (http://django-smart-autoregister.readthedocs.io/en/latest/about.html#pull-requests-tips), but I'm not sure about the project setup so that the tests will run. Do you install Django in a virtual env and then install django-smart-autoregister as a source package in order to work on it? Thanks for any hint on the dev setup regarding this matter.

Cheers Lucas

paulocheque commented 7 years ago

Thanks for reporting!

Try this:

If everything is ok, then start editing the code.

Before creating the PR:

paulocheque commented 7 years ago

I had the same problem in another lib: https://github.com/paulocheque/django-dynamic-fixture/blob/master/runtests.py

A PR for the following method would be awesome! https://github.com/paulocheque/django-smart-autoregister/blob/master/django_smart_autoregister/django_helper.py#L20

lutuh commented 7 years ago

I am about to commit my changes. Running make tox, I notice that the tests are failing with Django 1.7 and Python 3.5. When I stash my changes and run the tests against commit c88e53f (working directory clean), the tests still fail with Django 1.7:

(env) [~/source/django-smart-autoregister]$ pip install Django==1.7.11
[...]
(env) [~/source/django-smart-autoregister]$ make test
Django (1, 7, 11, 'final', 0)
Traceback (most recent call last):
  File "runtests.py", line 21, in <module>
    django.setup()
[...]
  File "/home/abc/source/django-smart-autoregister/env/lib/python3.5/site-packages/django/utils/html_parser.py", line 12, in <module>
    HTMLParseError = _html_parser.HTMLParseError

Can you confirm this? I am happy to create the PR if this is a known bug.

lutuh commented 6 years ago

Yay, the test against Django 1.7 was only failing on my local machine, but not in the Travis build. So here is the PR! #3 However, Travis could not find pypy, which is why I removed pypy from the Travis config. I have not found any solution for the InterpreterNotFound exception. They might have changed the configuration of their docker images. I would be happy to hear from you!