diff --git a/.gitignore b/.gitignore index b4755ec..13c6b6f 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,4 @@ testproject/htmlcov/ testproject/rosetta.db testproject/src/ testproject/.coverage -.venv_* +.tox diff --git a/CHANGES b/CHANGES index 3b23274..b2e00a0 100644 --- a/CHANGES +++ b/CHANGES @@ -10,6 +10,8 @@ Version 0.7.5 * Use content_type instead of mimetype in HttpResponse. (Issue #115, thanks @vesteinn) * Don't assume that request.user has settable properties, this was a silly idea anyway (Issue #114, thanks @stevejalim) * Preserve HTML code when receiving translations from the Yandex translation service (Issue #116, thanks @marcbelmont) +* Use TOX for testing +* Test against Django 1.8a Version 0.7.4 diff --git a/README.rst b/README.rst index fa716f3..d7c05fa 100644 --- a/README.rst +++ b/README.rst @@ -42,6 +42,11 @@ To install Rosetta: +Testing: + +``pip install tox && tox`` + + Note: you can use whatever you wish as the URL prefix. To uninstall Rosetta, simply comment out or remove the ``'rosetta'`` line in your ``INSTALLED_APPS`` diff --git a/rosetta/locale/pl/LC_MESSAGES/django.mo b/rosetta/locale/pl/LC_MESSAGES/django.mo index f0d5ac1..b05bf54 100644 Binary files a/rosetta/locale/pl/LC_MESSAGES/django.mo and b/rosetta/locale/pl/LC_MESSAGES/django.mo differ diff --git a/rosetta/tests/__init__.py b/rosetta/tests/__init__.py index 6aea359..8baa6e5 100644 --- a/rosetta/tests/__init__.py +++ b/rosetta/tests/__init__.py @@ -1,2 +1 @@ from .tests import * -from microsofttranslator.test import * diff --git a/rosetta/utils/__init__.py b/rosetta/utils/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/runtests_multi_venv.sh b/runtests_multi_venv.sh deleted file mode 100755 index 736e247..0000000 --- a/runtests_multi_venv.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/bash - -if [ ! -d .venv_14 ] -then - virtualenv --no-site-packages --distribute --python=python2.7 .venv_14 - . .venv_14/bin/activate - pip install --use-mirrors Django==1.4 coverage python-memcached six requests==2.1.0 polib==1.0.4 microsofttranslator==0.5 - deactivate -fi -if [ ! -d .venv_15 ] -then - virtualenv --no-site-packages --distribute --python=python2.7 .venv_15 - . .venv_15/bin/activate - pip install --use-mirrors Django==1.5 coverage python-memcached six requests==2.1.0 polib==1.0.4 microsofttranslator==0.5 - deactivate -fi -if [ ! -d .venv_15_p3 ] -then - virtualenv --no-site-packages --distribute --python=python3 .venv_15_p3 - . .venv_15_p3/bin/activate - pip install --use-mirrors Django==1.5 coverage python3-memcached six requests==2.1.0 polib==1.0.4 microsofttranslator==0.5 - deactivate -fi -if [ ! -d .venv_16 ] -then - virtualenv --no-site-packages --distribute --python=python2.7 .venv_16 - . .venv_16/bin/activate - pip install --use-mirrors coverage python-memcached six Django==1.6.1 requests==2.1.0 polib==1.0.4 microsofttranslator==0.5 - deactivate -fi -if [ ! -d .venv_16_p3 ] -then - virtualenv --no-site-packages --distribute --python=python3 .venv_16_p3 - . .venv_16_p3/bin/activate - pip install --use-mirrors coverage python3-memcached six Django==1.6.1 requests==2.1.0 polib==1.0.4 microsofttranslator==0.5 - deactivate -fi -if [ ! -d .venv_17 ] -then - virtualenv --no-site-packages --distribute --python=python2.7 .venv_17 - . .venv_17/bin/activate - pip install Django==1.7 - pip install --use-mirrors coverage python-memcached six requests==2.1.0 polib==1.0.4 microsofttranslator==0.5 - deactivate -fi -if [ ! -d .venv_17_p3 ] -then - virtualenv --no-site-packages --distribute --python=python3 .venv_17_p3 - . .venv_17_p3/bin/activate - pip install Django==1.7 - pip install --use-mirrors coverage python3-memcached six requests==2.1.0 polib==1.0.4 microsofttranslator==0.5 - deactivate -fi - - -. .venv_14/bin/activate -cd testproject -python manage.py --version -python --version -python manage.py test rosetta -cd .. -deactivate - -. .venv_15/bin/activate -cd testproject -python manage.py --version -python --version -python manage.py test rosetta -cd .. -deactivate - -. .venv_15_p3/bin/activate -cd testproject -python manage.py --version -python --version -python manage.py test rosetta -cd .. -deactivate - -. .venv_16/bin/activate -cd testproject -python manage.py --version -python --version -python manage.py test rosetta -cd .. -deactivate - -. .venv_16_p3/bin/activate -cd testproject -python manage.py --version -python --version -python manage.py test rosetta -cd .. -deactivate - -. .venv_17/bin/activate -cd testproject -python manage.py --version -python --version -python manage.py test rosetta -cd .. -deactivate - -. .venv_17_p3/bin/activate -cd testproject -python manage.py --version -python --version -python manage.py test rosetta -cd .. -deactivate - -# Check translations -for d in `find rosetta -name LC_MESSAGES -type d`; do msgfmt -c -o $d/django.mo $d/django.po; done diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..9f249dc --- /dev/null +++ b/tox.ini @@ -0,0 +1,49 @@ +[tox] +envlist = + {py26,py27}-django14, + {py26,py27,py34}-django{15,16}, + {py27,py34}-django{17,18alpha}, + gettext + +skipsdist = True + + +[testenv] +changedir = testproject +commands = + python manage.py test rosetta + +setenv = + PYTHONDONTWRITEBYTECODE=1 + +deps = + django14: Django==1.4.19 + django15: Django==1.5.12 + django16: Django==1.6.10 + django17: Django==1.7.4 + django18alpha: https://www.djangoproject.com/download/1.8a1/tarball/ + {py26,py27}-django{14,15,16,17,18alpha}: python-memcached + py34-django{14,15,16,17,18alpha}: python3-memcached + requests + polib>=1.0.6 + microsofttranslator==0.5 + six + +[testenv:gettext] +changedir = rosetta/locale/ +whitelist_externals = + msgfmt + +commands = + msgfmt -c -o cs/LC_MESSAGES/django.mo cs/LC_MESSAGES/django.po + msgfmt -c -o de/LC_MESSAGES/django.mo de/LC_MESSAGES/django.po + msgfmt -c -o es/LC_MESSAGES/django.mo es/LC_MESSAGES/django.po + msgfmt -c -o fa/LC_MESSAGES/django.mo fa/LC_MESSAGES/django.po + msgfmt -c -o fr/LC_MESSAGES/django.mo fr/LC_MESSAGES/django.po + msgfmt -c -o hu/LC_MESSAGES/django.mo hu/LC_MESSAGES/django.po + msgfmt -c -o it/LC_MESSAGES/django.mo it/LC_MESSAGES/django.po + msgfmt -c -o nl/LC_MESSAGES/django.mo nl/LC_MESSAGES/django.po + msgfmt -c -o pl/LC_MESSAGES/django.mo pl/LC_MESSAGES/django.po + msgfmt -c -o ru/LC_MESSAGES/django.mo ru/LC_MESSAGES/django.po + msgfmt -c -o tr/LC_MESSAGES/django.mo tr/LC_MESSAGES/django.po + msgfmt -c -o uk/LC_MESSAGES/django.mo uk/LC_MESSAGES/django.po