File tree Expand file tree Collapse file tree 2 files changed +30
-6
lines changed Expand file tree Collapse file tree 2 files changed +30
-6
lines changed Original file line number Diff line number Diff line change @@ -3,12 +3,26 @@ language: python
3
3
python :
4
4
- 2.6
5
5
- 2.7
6
+ - 3.2
7
+ - 3.3
6
8
- pypy
7
9
10
+ env :
11
+ - DJANGO=Django==1.6
12
+ - DJANGO=git+https://github.com/django/django.git@stable/1.7.x
13
+
14
+ matrix :
15
+ exclude :
16
+ - python : 2.6
17
+ env : DJANGO=git+https://github.com/django/django.git@stable/1.7.x
18
+ allow_failures :
19
+ - env : DJANGO=git+https://github.com/django/django.git@stable/1.7.x
20
+
8
21
install :
9
- - pip install -e .
10
- - pip install --use-mirrors coveralls
11
- - pip install --use-mirrors nose
22
+ - pip install -q -e .
23
+ - pip install -q $DJANGO
24
+ - pip install -q --use-mirrors coveralls
25
+ - pip install -q --use-mirrors nose
12
26
13
27
script : coverage run --source=menu `which django-admin.py` test --settings=menu.test_settings menu
14
28
Original file line number Diff line number Diff line change
1
+ import re
2
+
1
3
from django .conf import settings
2
4
3
- import re
5
+ try :
6
+ from django .apps import apps
7
+ except ImportError :
8
+ apps = False
4
9
5
10
6
11
class Menu (object ):
@@ -47,15 +52,20 @@ def load_menus(c):
47
52
if c .loaded :
48
53
return
49
54
55
+ # Fetch all installed app names
56
+ app_names = settings .INSTALLED_APPS
57
+ if apps :
58
+ app_names = [app_config .name for app_config in apps .get_app_configs ()]
59
+
50
60
# loop through our INSTALLED_APPS
51
- for app in settings . INSTALLED_APPS :
61
+ for app in app_names :
52
62
# skip any django apps
53
63
if app .startswith ("django." ):
54
64
continue
55
65
56
66
menu_module = '%s.menus' % app
57
67
try :
58
- __import__ (menu_module , fromlist = ["menu" ])
68
+ __import__ (menu_module , fromlist = ["menu" , ])
59
69
except ImportError :
60
70
pass
61
71
You can’t perform that action at this time.
0 commit comments