Skip to content

Commit 264f447

Browse files
committed
Separate tests and testproject
1 parent c55dff3 commit 264f447

File tree

10 files changed

+10
-13
lines changed

10 files changed

+10
-13
lines changed

setup.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@
22
universal = 1
33

44
[tool:pytest]
5-
DJANGO_SETTINGS_MODULE = tests.settings
6-
norecursedirs = .git .tox .eggs .cache htmlcov venv*
5+
DJANGO_SETTINGS_MODULE = testproject.settings
File renamed without changes.

tests/settings.py renamed to testproject/settings.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import os
1+
import pkg_resources
22

33
SECRET_KEY = 'x'
44
USE_I18N = True
5-
ROOT_URLCONF = 'tests.urls'
5+
ROOT_URLCONF = 'testproject.urls'
66
INSTALLED_APPS = [
77
'django_babel',
8-
'tests',
8+
'testproject',
99
]
1010
MIDDLEWARE_CLASSES = [
1111
'django.middleware.locale.LocaleMiddleware',
@@ -24,5 +24,5 @@
2424
},
2525
]
2626
LOCALE_PATHS = [
27-
os.path.join(os.path.dirname(__file__), 'locale'),
27+
pkg_resources.resource_filename(__name__, 'locale'),
2828
]
File renamed without changes.
File renamed without changes.

tests/babel.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[django: templates/**.*]
1+
[django: **/templates/**.*]

tests/test_command.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import os
22

3+
import pkg_resources
34
from django.core.management import call_command
45

5-
TEST_LOCALE_DIR = os.path.join(
6-
os.path.dirname(__file__),
7-
'locale',
8-
)
6+
TEST_LOCALE_DIR = pkg_resources.resource_filename('testproject', 'locale')
97

108

119
def test_babel_compilemessages():
@@ -25,7 +23,7 @@ def test_babel_makemessages():
2523
'babel',
2624
'makemessages',
2725
'-l', 'en',
28-
'-F', os.path.join(os.path.dirname(__file__), 'babel.cfg'),
26+
'-F', pkg_resources.resource_filename(__name__, 'babel.cfg'),
2927
)
3028
# See that the expected files get populated with the discovered message
3129
for path in [

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = {py27,py34}-django{18,19,110,master}, py33-django18, lint, docs
2+
envlist = {py27,py34,py35}-django{18,19,110,master}, py33-django18, lint, docs
33

44
[testenv]
55
deps =

0 commit comments

Comments
 (0)