Esempio n. 1
0
def test_module_loaded_and_signal_fired():
    call_modules(('loadme',))

    tools.assert_true('test_ella.test_app.loadme' in sys.modules)
    loadme = sys.modules['test_ella.test_app.loadme']
    tools.assert_equals(1, len(loadme.run_log))
    tools.assert_equals(((), {'signal': app_modules_loaded, 'sender': None}), loadme.run_log[0])
Esempio n. 2
0
def setup():
    global test_runner
    global old_config
    from django.test.simple import DjangoTestSuiteRunner
    from ella.utils.installedapps import call_modules
    test_runner = DjangoTestSuiteRunner()
    test_runner.setup_test_environment()
    old_config = test_runner.setup_databases()
    call_modules(('register', ))
Esempio n. 3
0
def setup():
    global test_runner
    global old_config
    from django.test.simple import DjangoTestSuiteRunner
    from ella.utils.installedapps import call_modules
    test_runner = DjangoTestSuiteRunner()
    test_runner.setup_test_environment()
    old_config = test_runner.setup_databases()
    call_modules(('register', ))
Esempio n. 4
0
def test_module_loaded_and_signal_fired():
    call_modules(('loadme', ))

    tools.assert_true('test_ella.test_app.loadme' in sys.modules)
    loadme = sys.modules['test_ella.test_app.loadme']
    tools.assert_equals(1, len(loadme.run_log))
    tools.assert_equals(((), {
        'signal': app_modules_loaded,
        'sender': None
    }), loadme.run_log[0])
Esempio n. 5
0
def setup():
    global test_runner
    global old_config
    from ella.utils.installedapps import call_modules
    try:
        from django.test.runner import DiscoverRunner as TestRunner
    except ImportError:
        from django.test.simple import DjangoTestSuiteRunner as TestRunner
    try:
        django.setup()
    except AttributeError:
        pass
    test_runner = TestRunner()
    test_runner.setup_test_environment()
    old_config = test_runner.setup_databases()
    call_modules(('register', ))
Esempio n. 6
0
def autodiscover():
    call_modules(auto_discover=(
        'newman_admin',
        'admin',
    ))
Esempio n. 7
0
from django.conf import settings
from django.conf.urls.defaults import *

from ella import newman


# Hack to allow Ella to handle default django documentation
# FIXME: Should be set some where else (in Ella?)
from django.contrib import admin
admin.site.root = '/newman/django-admin'

# register ella's admin
newman.autodiscover()

from ella.utils.installedapps import call_modules
call_modules(auto_discover=('register',))

urlpatterns = patterns('', )
# urlpatterns = patterns('',
#     (r'^sitemap\.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps}),
# )

if settings.ENABLE_DEBUG_URLS:
    # only use these urls in DEBUG mode, otherwise they should be handled by your web server
    import django, ella
    from os.path import dirname, join, normpath

    # static files from both admin apps
    DJANGO_ADMIN_ROOT = normpath(join(dirname(django.__file__), 'contrib', 'admin', 'media'))
    ADMIN_ROOTS = (
        normpath(join(dirname(ella.__file__), 'newman', 'media')),
Esempio n. 8
0
def autodiscover():
    call_modules(auto_discover=('newman_admin', 'admin',))
Esempio n. 9
0
from django.conf.urls.defaults import *
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.conf import settings
from django.contrib.staticfiles.urls import staticfiles_urlpatterns

# register apps for Django admin and let the apps do any initialization they need
from ella.utils.installedapps import call_modules
call_modules(('admin','register',))

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'elablog.views.home', name='home'),
    # url(r'^blog/', include('blog.urls')),

    url(r'^admin/', include(admin.site.urls)),
)

urlpatterns += patterns('',
    # serve media files
    (r'^%s/(?P<path>.*)$' settings.MEDIA_URL, 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),

    # run Django admin
    (r'^admin/', include(admin.site.urls)),

    # enable Ella
    (r'^', include('ella.core.urls')),
) + staticfiles_urlpatterns()
Esempio n. 10
0
from django.conf.urls import include, url

from ella.utils.installedapps import call_modules

call_modules(('register', ))

urlpatterns = [
    url(r'^', include('ella.core.urls')),
]