summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--django/conf/__init__.py2
-rw-r--r--tests/regressiontests/app_loading/__init__.py0
-rw-r--r--tests/regressiontests/app_loading/models.py0
-rw-r--r--tests/regressiontests/app_loading/parent/__init__.py1
-rw-r--r--tests/regressiontests/app_loading/parent/app/__init__.py1
-rw-r--r--tests/regressiontests/app_loading/parent/app1/__init__.py1
-rw-r--r--tests/regressiontests/app_loading/test_settings.py3
-rw-r--r--tests/regressiontests/app_loading/tests.py18
8 files changed, 25 insertions, 1 deletions
diff --git a/django/conf/__init__.py b/django/conf/__init__.py
index 425425bc5f..785302c6fd 100644
--- a/django/conf/__init__.py
+++ b/django/conf/__init__.py
@@ -92,7 +92,7 @@ class Settings(object):
app_subdirs = os.listdir(appdir)
app_subdirs.sort()
for d in app_subdirs:
- if d.isalpha() and os.path.isdir(os.path.join(appdir, d)):
+ if d.isalnum() and d[0].isalpha() and os.path.isdir(os.path.join(appdir, d)):
new_installed_apps.append('%s.%s' % (app[:-2], d))
else:
new_installed_apps.append(app)
diff --git a/tests/regressiontests/app_loading/__init__.py b/tests/regressiontests/app_loading/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/regressiontests/app_loading/__init__.py
diff --git a/tests/regressiontests/app_loading/models.py b/tests/regressiontests/app_loading/models.py
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/regressiontests/app_loading/models.py
diff --git a/tests/regressiontests/app_loading/parent/__init__.py b/tests/regressiontests/app_loading/parent/__init__.py
new file mode 100644
index 0000000000..51c842b5ba
--- /dev/null
+++ b/tests/regressiontests/app_loading/parent/__init__.py
@@ -0,0 +1 @@
+# not empty to make SVN happy
diff --git a/tests/regressiontests/app_loading/parent/app/__init__.py b/tests/regressiontests/app_loading/parent/app/__init__.py
new file mode 100644
index 0000000000..51c842b5ba
--- /dev/null
+++ b/tests/regressiontests/app_loading/parent/app/__init__.py
@@ -0,0 +1 @@
+# not empty to make SVN happy
diff --git a/tests/regressiontests/app_loading/parent/app1/__init__.py b/tests/regressiontests/app_loading/parent/app1/__init__.py
new file mode 100644
index 0000000000..51c842b5ba
--- /dev/null
+++ b/tests/regressiontests/app_loading/parent/app1/__init__.py
@@ -0,0 +1 @@
+# not empty to make SVN happy
diff --git a/tests/regressiontests/app_loading/test_settings.py b/tests/regressiontests/app_loading/test_settings.py
new file mode 100644
index 0000000000..e956311b0a
--- /dev/null
+++ b/tests/regressiontests/app_loading/test_settings.py
@@ -0,0 +1,3 @@
+INSTALLED_APPS = (
+ 'parent.*',
+)
diff --git a/tests/regressiontests/app_loading/tests.py b/tests/regressiontests/app_loading/tests.py
new file mode 100644
index 0000000000..afa3049330
--- /dev/null
+++ b/tests/regressiontests/app_loading/tests.py
@@ -0,0 +1,18 @@
+"""
+Test the globbing of INSTALLED_APPS.
+
+>>> import os, sys
+>>> old_sys_path = sys.path
+>>> sys.path.append(os.path.dirname(os.path.abspath(__file__)))
+
+>>> from django.conf import Settings
+
+>>> s = Settings('test_settings')
+
+>>> s.INSTALLED_APPS
+['parent.app', 'parent.app1']
+
+>>> sys.path = old_sys_path
+
+"""
+