Skip to content

Commit

Permalink
Monkey patch the CKEditor widget for Django@master compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Oct 26, 2017
1 parent 6acda50 commit 0ce095d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/testapp/test_feincms3.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,23 @@ def merge_dicts(*dicts):
return res


def monkeypatches():
import django

if django.VERSION >= (2, 1):
from ckeditor.widgets import CKEditorWidget
_original_render = CKEditorWidget.render
def render(self, name, value, attrs=None, renderer=None):
return _original_render(self, name, value, attrs=attrs)
CKEditorWidget.render = render


class Test(TestCase):
def setUp(self):
self.user = User.objects.create_superuser(
'admin', 'admin@test.ch', 'blabla')
deactivate_all()
monkeypatches()

def login(self):
client = Client()
Expand Down

0 comments on commit 0ce095d

Please sign in to comment.