Beispiel #1
0
    def _pre_setup(self):
        # Add the models to the db.
        self._original_installed_apps = list(settings.INSTALLED_APPS)
        for app in self.apps:
            settings.INSTALLED_APPS.append(app)
        loading.cache.loaded = False
        call_command('syncdb', interactive=False, verbosity=0)
        call_command('update_badges', verbosity=0)
        badger.autodiscover()

        if get_url_prefix:
            # If we're in funfactoryland, make sure a locale prefix is
            # set for urlresolvers
            locale = 'en-US'
            self.old_prefix = get_url_prefix()
            self.old_locale = get_language()
            rf = RequestFactory()
            set_url_prefix(Prefixer(rf.get('/%s/' % (locale, ))))
            activate(locale)

        # Create a default user for tests
        self.user_1 = self._get_user(username="******",
                                     email="*****@*****.**",
                                     password="******")

        # Call the original method that does the fixtures etc.
        super(test.TestCase, self)._pre_setup()
Beispiel #2
0
    def _pre_setup(self):
        # Add the models to the db.
        self._original_installed_apps = list(settings.INSTALLED_APPS)
        for app in self.apps:
            settings.INSTALLED_APPS.append(app)
        loading.cache.loaded = False
        call_command('syncdb', interactive=False, verbosity=0)
        call_command('update_badges', verbosity=0)
        badger.autodiscover()

        if get_url_prefix:
            # If we're in funfactoryland, make sure a locale prefix is 
            # set for urlresolvers
            locale = 'en-US'
            self.old_prefix = get_url_prefix()
            self.old_locale = get_language()
            rf = RequestFactory()
            set_url_prefix(Prefixer(rf.get('/%s/' % (locale,))))
            activate(locale)

        # Create a default user for tests
        self.user_1 = self._get_user(username="******",
                                     email="*****@*****.**",
                                     password="******")

        # Call the original method that does the fixtures etc.
        super(test.TestCase, self)._pre_setup()
Beispiel #3
0
 def _pre_setup(self):
     # Add the models to the db.
     self._original_installed_apps = list(settings.INSTALLED_APPS)
     for app in self.apps:
         settings.INSTALLED_APPS.append(app)
     loading.cache.loaded = False
     call_command('syncdb', interactive=False, verbosity=0)
     call_command('update_badges', verbosity=0)
     badger.autodiscover()
     # Call the original method that does the fixtures etc.
     super(test.TestCase, self)._pre_setup()
Beispiel #4
0
 def _pre_setup(self):
     # Add the models to the db.
     self._original_installed_apps = list(settings.INSTALLED_APPS)
     for app in self.apps:
         settings.INSTALLED_APPS.append(app)
     loading.cache.loaded = False
     call_command('syncdb', interactive=False, verbosity=0)
     call_command('update_badges', verbosity=0)
     badger.autodiscover()
     # Call the original method that does the fixtures etc.
     super(test.TestCase, self)._pre_setup()
Beispiel #5
0
    def _pre_setup(self):
        loading.cache.loaded = False
        call_command('update_badges', verbosity=0)
        badger.autodiscover()

        if get_url_prefix:
            # If we're in funfactoryland, make sure a locale prefix is
            # set for urlresolvers
            locale = 'en-US'
            self.old_prefix = get_url_prefix()
            self.old_locale = get_language()
            rf = RequestFactory()
            set_url_prefix(Prefixer(rf.get('/%s/' % (locale,))))

        # Create a default user for tests
        self.user_1 = self._get_user(username="******",
                                     email="*****@*****.**",
                                     password="******")

        # Call the original method that does the fixtures etc.
        super(test.TestCase, self)._pre_setup()
    def _pre_setup(self):
        loading.cache.loaded = False
        call_command('update_badges', verbosity=0)
        badger.autodiscover()

        if get_url_prefix:
            # If we're in funfactoryland, make sure a locale prefix is
            # set for urlresolvers
            locale = 'en-US'
            self.old_prefix = get_url_prefix()
            self.old_locale = get_language()
            rf = RequestFactory()
            set_url_prefix(Prefixer(rf.get('/%s/' % (locale, ))))

        # Create a default user for tests
        self.user_1 = self._get_user(username="******",
                                     email="*****@*****.**",
                                     password="******")

        # Call the original method that does the fixtures etc.
        super(test.TestCase, self)._pre_setup()
Beispiel #7
0
from django.conf.urls import include, patterns, url
from django.conf import settings
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.shortcuts import redirect, render
from django.views.i18n import javascript_catalog
from django.views.decorators.cache import cache_page

import jingo
import badger


admin.autodiscover()
badger.autodiscover()


urlpatterns = patterns('',
   # Home / landing pages:
    ('', include('landing.urls')),
    ('', include('devmo.urls')),
    (r'^demos/', include('demos.urls')),
    (r'^demos', lambda x: redirect('demos')),

    # Django admin:
    (r'^grappelli/', include('grappelli.urls')),
    (r'^admin/', include('smuggler.urls')),
    (r'^admin/', include(admin.site.urls)),

    (r'^search', include('search.urls')),

    (r'^docs', include('wiki.urls')),
Beispiel #8
0
import authority
import badger
from waffle.views import wafflejs

# Note: This must come before importing admin because it patches the
# admin.
from kitsune.sumo.monkeypatch import patch

patch()

from django.contrib import admin  # noqa

admin.autodiscover()

authority.autodiscover()
badger.autodiscover()

urlpatterns = patterns(
    '',
    (r'^search', include('kitsune.search.urls')),
    (r'^forums', include('kitsune.forums.urls')),
    (r'^questions', include('kitsune.questions.urls')),
    (r'^flagged', include('kitsune.flagit.urls')),
    (r'^upload', include('kitsune.upload.urls')),
    (r'^kb', include('kitsune.wiki.urls')),
    (r'^gallery', include('kitsune.gallery.urls')),
    (r'^army-of-awesome', include('kitsune.customercare.urls')),
    (r'^chat', RedirectView.as_view(url='questions/new')),
    (r'^messages', include('kitsune.messages.urls')),
    (r'^1', include('kitsune.inproduct.urls')),
    (r'^postcrash', include('kitsune.postcrash.urls')),