Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

more django compatibility fixes

update vendor submodule to django 1.4.5 commit

restore CSRF in templates
  • Loading branch information...
commit ca6666ee6f3987450718bde29beb426a9030d36c 1 parent 3814530
@groovecoder groovecoder authored
View
3  apps/devmo/tests/__init__.py
@@ -113,10 +113,11 @@ class override_settings(overrider):
"""Decorator / context manager to override Django settings"""
def enable(self):
+ self.old_settings = settings._wrapped
override = UserSettingsHolder(settings._wrapped)
for key, new_value in self.options.items():
setattr(override, key, new_value)
settings._wrapped = override
def disable(self):
- settings._wrapped = self.wrapped
+ settings._wrapped = self.old_settings
View
1  apps/wiki/templates/wiki/edit_document.html
@@ -16,6 +16,7 @@
<div id="content-main" class="full">
<article id="edit-document" class="article" role="main">
<form id="wiki-page-edit" class="editing" method="post" action="">
+ {{ csrf() }}
<fieldset>
{{ errorlist(revision_form) }}
View
1  apps/wiki/templates/wiki/includes/attachment_list.html
@@ -33,6 +33,7 @@
{% if show_attach_button and attachment_form %}
<form method="post" action="{{ url('wiki.new_attachment') }}" id="page-attachments-form" enctype="multipart/form-data">
+ {{ csrf() }}
<table cellpadding="0" cellspacing="0" id="page-attachments-new-table" class="hidden">
<thead>
<th class="hidden page-attachment-actions-cell">&nbsp;</th>
View
9 apps/wiki/tests/test_tasks.py
@@ -13,6 +13,7 @@
from test_utils import RequestFactory
from sumo.tests import TestCase
+from devmo.tests import override_settings
from wiki.tasks import (send_reviewed_notification, rebuild_kb,
schedule_rebuild_kb, _rebuild_kb_chunk)
from wiki.tests import TestCaseBase, revision
@@ -42,21 +43,20 @@ class RebuildTestCase(TestCase):
ALWAYS_EAGER = celery.conf.ALWAYS_EAGER
def setUp(self):
- self.old_settings = deepcopy(settings._wrapped.__dict__)
- settings.WIKI_REBUILD_ON_DEMAND = True
celery.conf.ALWAYS_EAGER = True
def tearDown(self):
cache.delete(settings.WIKI_REBUILD_TOKEN)
- settings._wrapped.__dict__ = self.old_settings
celery.conf.ALWAYS_EAGER = self.ALWAYS_EAGER
@mock.patch_object(rebuild_kb, 'delay')
+ @override_settings(WIKI_REBUILD_ON_DEMAND=True)
def test_eager_queue(self, delay):
schedule_rebuild_kb()
assert not cache.get(settings.WIKI_REBUILD_TOKEN)
assert not delay.called
+ @override_settings(WIKI_REBUILD_ON_DEMAND=True)
@mock.patch_object(rebuild_kb, 'delay')
def test_task_queue(self, delay):
celery.conf.ALWAYS_EAGER = False
@@ -64,6 +64,7 @@ def test_task_queue(self, delay):
assert cache.get(settings.WIKI_REBUILD_TOKEN)
assert delay.called
+ @override_settings(WIKI_REBUILD_ON_DEMAND=True)
@mock.patch_object(rebuild_kb, 'delay')
def test_already_queued(self, delay):
cache.set(settings.WIKI_REBUILD_TOKEN, True)
@@ -71,6 +72,7 @@ def test_already_queued(self, delay):
assert cache.get(settings.WIKI_REBUILD_TOKEN)
assert not delay.called
+ @override_settings(WIKI_REBUILD_ON_DEMAND=True)
@mock.patch_object(rebuild_kb, 'delay')
@mock.patch_object(cache, 'get')
def test_dont_queue(self, get, delay):
@@ -79,6 +81,7 @@ def test_dont_queue(self, get, delay):
assert not get.called
assert not delay.called
+ @override_settings(WIKI_REBUILD_ON_DEMAND=True)
@mock.patch_object(_rebuild_kb_chunk, 'apply_async')
def test_rebuild_chunk(self, apply_async):
cache.set(settings.WIKI_REBUILD_TOKEN, True)
View
6 puppet/files/vagrant/settings_local.py
@@ -34,12 +34,14 @@
INSTALLED_APPS = INSTALLED_APPS + (
"django_extensions",
- "debug_toolbar",
+ # TODO: re-enable after django 1.4
+ # "debug_toolbar",
"devserver",
)
MIDDLEWARE_CLASSES = (
- "debug_toolbar.middleware.DebugToolbarMiddleware",
+ # TODO: re-enable after django 1.4
+ # "debug_toolbar.middleware.DebugToolbarMiddleware",
) + MIDDLEWARE_CLASSES
DEBUG_TOOLBAR_CONFIG = {
2  vendor
@@ -1 +1 @@
-Subproject commit 2e38a2af9774395fb754948745837f63cdf7e77f
+Subproject commit dbf695831147b2be14a7e0849027e3c2a98bc53f
Please sign in to comment.
Something went wrong with that request. Please try again.