From 68ad26fc12042ac1212e555d894217b699731131 Mon Sep 17 00:00:00 2001 From: benzkji Date: Tue, 1 May 2018 17:30:33 +0200 Subject: [PATCH] django 2.0 on the way --- CHANGELOG.txt | 2 ++ makemessages.sh | 5 ---- separate_users/tests/settings.py | 2 ++ .../tests/test_app/migrations/0001_initial.py | 4 +-- separate_users/tests/test_permissions.py | 11 +++++-- separate_users/tests/urls.py | 4 +-- setup.py | 2 +- tox.ini | 30 +++++-------------- compilemessages.sh => translations.sh | 2 ++ 9 files changed, 28 insertions(+), 34 deletions(-) delete mode 100755 makemessages.sh rename compilemessages.sh => translations.sh (53%) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index ecb4cfa..834df41 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -7,3 +7,5 @@ ==== 0.0.1 === - initial release +- support for django 1.11+ +- support for custom user model still experimental, as nobody uses this, and it's hard to test. diff --git a/makemessages.sh b/makemessages.sh deleted file mode 100755 index d0185b4..0000000 --- a/makemessages.sh +++ /dev/null @@ -1,5 +0,0 @@ - - -cd separate_users -django-admin.py makemessages -l en -cd .. \ No newline at end of file diff --git a/separate_users/tests/settings.py b/separate_users/tests/settings.py index e22e8f2..5df7bc3 100644 --- a/separate_users/tests/settings.py +++ b/separate_users/tests/settings.py @@ -93,6 +93,8 @@ 'django.middleware.locale.LocaleMiddleware', ) +MIDDLEWARE = MIDDLEWARE_CLASSES + INSTALLED_APPS = EXTERNAL_APPS + INTERNAL_APPS COVERAGE_MODULE_EXCLUDES += EXTERNAL_APPS diff --git a/separate_users/tests/test_app/migrations/0001_initial.py b/separate_users/tests/test_app/migrations/0001_initial.py index 13c409c..cfa40db 100644 --- a/separate_users/tests/test_app/migrations/0001_initial.py +++ b/separate_users/tests/test_app/migrations/0001_initial.py @@ -21,7 +21,7 @@ class Migration(migrations.Migration): }, bases=('auth.user',), managers=[ - (b'objects', separate_users.models.EditorManager()), + ('objects', separate_users.models.EditorManager()), ], ), migrations.CreateModel( @@ -33,7 +33,7 @@ class Migration(migrations.Migration): }, bases=('auth.user',), managers=[ - (b'objects', separate_users.models.FrontendUserManager()), + ('objects', separate_users.models.FrontendUserManager()), ], ), ] diff --git a/separate_users/tests/test_permissions.py b/separate_users/tests/test_permissions.py index 5930b15..8499ed4 100644 --- a/separate_users/tests/test_permissions.py +++ b/separate_users/tests/test_permissions.py @@ -1,10 +1,17 @@ # -*- coding: utf-8 -*- from django.contrib.auth.models import Permission -from django.core.urlresolvers import reverse -from django.test import Client +# from django.test import Client from django.test import TestCase +# compat +import django +if django.VERSION[:2] < (1, 10): + from django.core.urlresolvers import reverse +else: + from django.urls import reverse + + class PermissionsTestCase(TestCase): """ check if permissions are there, after management command was run. diff --git a/separate_users/tests/urls.py b/separate_users/tests/urls.py index 1a1c868..496441a 100644 --- a/separate_users/tests/urls.py +++ b/separate_users/tests/urls.py @@ -1,8 +1,8 @@ """URLs to run the tests.""" -from django.conf.urls import include, url +from django.conf.urls import url from django.contrib import admin urlpatterns = [ - url(r'^admin/', include(admin.site.urls)), + url(r'^admin/', admin.site.urls), ] diff --git a/setup.py b/setup.py index 17b76dc..386d682 100755 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ def read(fname): packages=find_packages(), install_requires=( # 'Django>=1.3,<1.5', # no need to limit while in development - 'Django>=1.8', + 'Django>=1.11', ), include_package_data=True, zip_safe=False, diff --git a/tox.ini b/tox.ini index e9a6595..df48d21 100644 --- a/tox.ini +++ b/tox.ini @@ -1,35 +1,21 @@ - [tox] -envlist = django18, django19, django110, django111 +envlist = py{27,36}-django{111,20} [testenv] commands = python manage.py test setenv = DJANGO_SETTINGS_MODULE=separate_users.tests.settings PYTHONPATH={toxinidir} - -[base] deps = + django111: Django>=1.11,<2.0 + django20: Django>=2.0,<2.1 coverage django-coverage - flake8 - -[testenv:django18] -deps = - {[base]deps} - django>=1.8, <1.9 -[testenv:django19] +[testenv:py27-django20] +whitelist_externals = echo deps = - {[base]deps} - django>=1.9, <1.10 +commands= echo "no django 2.0 on python 2.7!" -[testenv:django110] -deps = - {[base]deps} - django>=1.10, <1.11 - -[testenv:django111] -deps = - {[base]deps} - django>=1.11, <1.12 +[testenv:flake8] +commands = flake8 diff --git a/compilemessages.sh b/translations.sh similarity index 53% rename from compilemessages.sh rename to translations.sh index f519a5c..c5dea9f 100755 --- a/compilemessages.sh +++ b/translations.sh @@ -1,4 +1,6 @@ + cd separate_users +django-admin.py makemessages -l en -l de -l fr django-admin.py compilemessages cd .. \ No newline at end of file