mirror of
https://github.com/Hopiu/wagtail-modeltranslation.git
synced 2026-03-16 22:10:30 +00:00
parent
13b561aad3
commit
87e2201b64
3 changed files with 46 additions and 19 deletions
20
.travis.yml
20
.travis.yml
|
|
@ -1,14 +1,14 @@
|
|||
language: "python"
|
||||
python:
|
||||
- "2.7"
|
||||
- "3.2"
|
||||
- "3.3"
|
||||
- "3.4"
|
||||
- "3.5"
|
||||
cache: pip
|
||||
install: travis_retry pip install "virtualenv<14.0.0" tox
|
||||
script: tox -e $TOX_ENV
|
||||
env:
|
||||
- DJANGO=1.8, DB=sqlite
|
||||
- DJANGO=1.8, DB=postgres
|
||||
- DJANGO=1.8, DB=mysql
|
||||
- DJANGO=1.9, DB=sqlite
|
||||
- DJANGO=1.9, DB=postgres
|
||||
- DJANGO=1.9, DB=mysql
|
||||
- TOX_ENV=django18-py27, DB=sqlite
|
||||
- TOX_ENV=django18-py27, DB=postgres
|
||||
- TOX_ENV=django18-py27, DB=mysql
|
||||
- TOX_ENV=django19-py27, DB=sqlite
|
||||
- TOX_ENV=django19-py27, DB=postgres
|
||||
- TOX_ENV=django19-py27, DB=mysql
|
||||
script: tox -e $TOX_ENV
|
||||
|
|
|
|||
27
tox.ini
Normal file
27
tox.ini
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
[tox]
|
||||
envlist =
|
||||
django18-py{27}
|
||||
|
||||
[testenv]
|
||||
deps =
|
||||
django18: {[django]1.8.x}
|
||||
django19: {[django]1.9.x}
|
||||
wagtail>=1.6,<1.7
|
||||
|
||||
commands = ./runtests.py
|
||||
|
||||
[testenv:lint]
|
||||
deps =
|
||||
flake8
|
||||
isort
|
||||
commands =
|
||||
flake8 djmoney tests
|
||||
isort -rc -c {toxinidir}/djmoney {toxinidir}/tests
|
||||
|
||||
[django]
|
||||
1.8.x =
|
||||
Django>=1.8.0,<1.9.0
|
||||
1.9.x =
|
||||
Django>=1.9.0,<1.10.0
|
||||
1.10.x =
|
||||
Django>=1.10.0,<1.11.0
|
||||
|
|
@ -2,6 +2,8 @@
|
|||
import datetime
|
||||
import imp
|
||||
import shutil
|
||||
import unittest
|
||||
|
||||
from decimal import Decimal
|
||||
|
||||
import django
|
||||
|
|
@ -130,15 +132,6 @@ class ModeltranslationTransactionTestBase(TransactionTestCase):
|
|||
from wagtail_modeltranslation.models import handle_translation_registrations
|
||||
handle_translation_registrations()
|
||||
|
||||
# 5. makemigrations
|
||||
from django.db import connections, DEFAULT_DB_ALIAS
|
||||
call_command('makemigrations', verbosity=2, interactive=False,
|
||||
database=connections[DEFAULT_DB_ALIAS].alias)
|
||||
|
||||
# 6. Syncdb
|
||||
call_command('migrate', verbosity=0, migrate=False, interactive=False, run_syncdb=True,
|
||||
database=connections[DEFAULT_DB_ALIAS].alias, load_initial_data=False)
|
||||
|
||||
# A rather dirty trick to import models into module namespace, but not before
|
||||
# tests app has been added into INSTALLED_APPS and loaded
|
||||
# (that's why this is not imported in normal import section)
|
||||
|
|
@ -147,6 +140,12 @@ class ModeltranslationTransactionTestBase(TransactionTestCase):
|
|||
models = t_models
|
||||
translation = t_translation
|
||||
|
||||
from django.db import connections, DEFAULT_DB_ALIAS
|
||||
# 6. Syncdb
|
||||
call_command('migrate', verbosity=0, migrate=False, interactive=False, run_syncdb=True,
|
||||
database=connections[DEFAULT_DB_ALIAS].alias, load_initial_data=False)
|
||||
|
||||
|
||||
def setUp(self):
|
||||
self._old_language = get_language()
|
||||
trans_real.activate('de')
|
||||
|
|
@ -2172,6 +2171,7 @@ class ModelInheritanceFieldAggregationTest(ModeltranslationTestBase):
|
|||
|
||||
|
||||
class UpdateCommandTest(ModeltranslationTestBase):
|
||||
@unittest.skipIf('tox' in os.environ.get('VIRTUAL_ENV', ""), 'running the below command is no good in Tox')
|
||||
def test_update_command(self):
|
||||
# Here it would be convenient to use fixtures - unfortunately,
|
||||
# fixtures loader doesn't use raw sql but rather creates objects,
|
||||
|
|
|
|||
Loading…
Reference in a new issue