Skip to content

Commit 86434d1

Browse files
committed
fixes missing import-export import error int tests
1 parent fd5f0c5 commit 86434d1

File tree

7 files changed

+14
-5
lines changed

7 files changed

+14
-5
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ env:
1515
- DJANGO="https://www.djangoproject.com/download/1.6a1/tarball/" DBENGINE=pg
1616

1717
install:
18+
- pip install -r demo/demoproject/requirements.pip
1819
- pip install -r requirements.pip
1920
- sh -c "if [ '$DBENGINE' = 'pg' ]; then pip install -q psycopg2; fi"
2021
- sh -c "if [ '$DBENGINE' = 'mysql' ]; then pip install -q MySQL-python; fi"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"pk": 1, "model": "demoapp.demomodel", "fields": {"char": "aa1", "integer": 1, "version": 1371221369533415}}, {"pk": 2, "model": "demoapp.demomodel", "fields": {"char": "bb41111111122aaa", "integer": 2, "version": 1371221369413696}}, {"pk": 3, "model": "demoapp.demomodel", "fields": {"char": "11", "integer": 11, "version": 1371221369252343}}]

demo/demoproject/demoapp/tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
import StringIO
2+
from six import StringIO
33
import os
44
from django.utils.translation import gettext as _
55
from django.contrib.auth.models import User

demo/demoproject/requirements.pip

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
django-import-export

demo/demoproject/settings.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
SITE_ID = 1
88
ROOT_URLCONF = 'demoproject.urls'
99
SECRET_KEY = ';klkj;okj;lkn;lklj;lkj;kjmlliuewhy2ioqwjdkh'
10-
INSTALLED_APPS = (
10+
INSTALLED_APPS = [
1111
'django.contrib.auth',
1212
'django.contrib.contenttypes',
1313
'django.contrib.sessions',
@@ -16,9 +16,13 @@
1616
'django.contrib.staticfiles',
1717
'django.contrib.admin',
1818
'concurrency',
19-
'import_export',
2019
'demoproject.demoapp'
21-
)
20+
]
21+
try:
22+
import import_export
23+
INSTALLED_APPS.append('import_export')
24+
except ImportError:
25+
pass
2226

2327
TEMPLATE_DIRS = ['demoproject/templates']
2428
from demoproject.settings_sqlite import * # NOQA

docs/install.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Option 2: using demo project
4646
::
4747

4848
$ cd demo
49+
$ pip install -r demoproject/requirements.pip
4950
$ ./manage.py test adminactions
5051

5152
Option 3: execute in your project

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ changedir=tests
2121
setenv =
2222
PYTHONPATH = {toxinidir}/demo
2323
commands =
24-
django-admin.py test concurrency --settings demoproject.settings --failfast --traceback
24+
pip install -r {toxinidir}/demo/demoproject/requirements.pip
25+
django-admin.py test concurrency demoapp --settings demoproject.settings --failfast --traceback
2526

2627
[testenv:d14]
2728
basepython = python2.7

0 commit comments

Comments
 (0)