diff --git a/combo/apps/wcs/models.py b/combo/apps/wcs/models.py index e1830706..1b722590 100644 --- a/combo/apps/wcs/models.py +++ b/combo/apps/wcs/models.py @@ -514,7 +514,7 @@ class WcsFormsOfCategoryCell(WcsCommonCategoryCell, WcsBlurpMixin): form['order'] = manual_order.index(form_reference) except ValueError: form['order'] = 9999 - extra_context['forms'] = sorted(extra_context['forms'], key=lambda x: x.get('order')) + extra_context['forms'] = sorted(extra_context['forms'], key=lambda x: x.get('order', 9999)) if self.limit: if len(extra_context['forms']) > self.limit: diff --git a/get_wcs.sh b/get_wcs.sh index d939cfd8..47c234b3 100755 --- a/get_wcs.sh +++ b/get_wcs.sh @@ -1,4 +1,6 @@ #!/bin/sh -xue +cd $TOX_WORK_DIR test -d wcs || git clone http://git.entrouvert.org/wcs.git (cd wcs && git pull) +rm -rf wcs/tests diff --git a/tests/test_wcs.py b/tests/test_wcs.py index ef556e6e..6dabae73 100644 --- a/tests/test_wcs.py +++ b/tests/test_wcs.py @@ -205,7 +205,7 @@ def setup_module(module): run_wcs_script('create-user', hostname) run_wcs_script('create-data', hostname) - fd = file(os.path.join(WCS_DIR, hostname, 'site-options.cfg'), 'w') + fd = open(os.path.join(WCS_DIR, hostname, 'site-options.cfg'), 'w') fd.write('''[api-secrets] combo = combo ''') diff --git a/tox.ini b/tox.ini index d74afdae..4b2a6ef0 100644 --- a/tox.ini +++ b/tox.ini @@ -5,9 +5,10 @@ envlist = coverage-py2-pylint,py3 [testenv] usedevelop = True setenv = - py2: WCS_MANAGE=wcs/wcsctl.py + WCS_MANAGE={toxworkdir}/wcs/wcsctl.py DJANGO_SETTINGS_MODULE=combo.settings COMBO_SETTINGS_FILE=tests/settings.py + TOX_WORK_DIR={toxworkdir} coverage: COVERAGE=--cov-report xml --cov-report html --cov=combo/ deps = django>=1.11,<1.12 @@ -26,13 +27,14 @@ deps = django-mellon>=1.13 py2: django-jsonfield<1.3 py2: quixote<3.0 - py2: vobject - py2: django-ratelimit<3 + py3: quixote>=3.0 + vobject + django-ratelimit<3 git+http://git.entrouvert.org/debian/django-ckeditor.git commands = py2: ./getlasso.sh py3: ./getlasso3.sh - py2: ./get_wcs.sh + ./get_wcs.sh python manage.py compilemessages py.test {env:COVERAGE:} {posargs: --junitxml=junit-{envname}.xml tests/} pylint: ./pylint.sh combo/