Skip to content

Commit a1d751b

Browse files
committed
Update TestSuit
1 parent 6bb4833 commit a1d751b

File tree

6 files changed

+10
-5
lines changed

6 files changed

+10
-5
lines changed

tests/runtests.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
import sys
55
import tempfile
66

7+
import django
8+
9+
710
TEST_ROOT = os.path.realpath(os.path.dirname(__file__))
811
RUNTESTS_DIR = os.path.join(TEST_ROOT, 'xtests')
912

@@ -72,6 +75,8 @@ def setup(verbosity, test_labels):
7275
# Load all the ALWAYS_INSTALLED_APPS.
7376
# (This import statement is intentionally delayed until after we
7477
# access settings because of the USE_I18N dependency.)
78+
79+
django.setup()
7580
from django.db.models.loading import get_apps, load_app
7681
get_apps()
7782

@@ -80,7 +85,7 @@ def setup(verbosity, test_labels):
8085
test_modules = get_test_modules()
8186

8287
for module_name in test_modules:
83-
module_label = '.'.join(['xtests', module_name])
88+
module_label = module_name
8489
# if the module was named on the command line, or
8590
# no modules were named (i.e., run all), import
8691
# this module and add it to the list to test.

tests/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
'ENGINE': 'django.db.backends.sqlite3',
55
}
66
}
7-
7+
MIDDLEWARE_CLASSES = ()
88
# Required for Django 1.4+
99
STATIC_URL = '/static/'
1010

tests/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from django.conf.urls import patterns, include
22

33
urlpatterns = patterns('',
4-
(r'^view_base/', include('xtests.view_base.urls')),
4+
(r'^view_base/', include('view_base.urls')),
55
)

tests/xtests/__init__.py

Whitespace-only changes.

tests/xtests/site/tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from django.http import HttpResponse
22

3-
from xtests.base import BaseTest
3+
from base import BaseTest
44
from xadmin.sites import AdminSite
55
from xadmin.views import BaseAdminView, BaseAdminPlugin, ModelAdminView, filter_hook
66

tests/xtests/view_base/tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
from django.contrib.auth.models import User
33

4-
from xtests.base import BaseTest
4+
from base import BaseTest
55
from xadmin.views import BaseAdminView, BaseAdminPlugin, ModelAdminView, ListAdminView
66

77
from models import ModelA, ModelB

0 commit comments

Comments
 (0)