{"action":"created","comment":{"url":"https://api.github.com/repos/torchbox/wagtail/pulls/comments/51360267","id":51360267,"diff_hunk":"@@ -0,0 +1,40 @@\n+from django.test import TestCase\n+from wagtail.wagtailcore.fields import BaseTextAreaWidget, RichTextArea\n+\n+\n+class TestBaseTextAreaWidget(TestCase):\n+\n+    def test_get_panel_implemented(self):\n+        with self.assertRaises(NotImplementedError):\n+            widget = BaseTextAreaWidget()\n+            widget.get_panel()\n+\n+    def test_render_js_init(self):","path":"wagtail/wagtailcore/tests/test_widgets.py","position":12,"original_position":12,"commit_id":"8cc7bfb75e94e6a35c0672d35c041f2bc9e82ff4","original_commit_id":"8cc7bfb75e94e6a35c0672d35c041f2bc9e82ff4","user":{"login":"m1kola","id":509198,"avatar_url":"https://avatars.githubusercontent.com/u/509198?v=3","gravatar_id":"","url":"https://api.github.com/users/m1kola","html_url":"https://github.com/m1kola","followers_url":"https://api.github.com/users/m1kola/followers","following_url":"https://api.github.com/users/m1kola/following{/other_user}","gists_url":"https://api.github.com/users/m1kola/gists{/gist_id}","starred_url":"https://api.github.com/users/m1kola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m1kola/subscriptions","organizations_url":"https://api.github.com/users/m1kola/orgs","repos_url":"https://api.github.com/users/m1kola/repos","events_url":"https://api.github.com/users/m1kola/events{/privacy}","received_events_url":"https://api.github.com/users/m1kola/received_events","type":"User","site_admin":false},"body":"I think we can remove this test because it checks `WidgetWithScript.render_js_init`. Probably `WidgetWithScript` should have own tests.","created_at":"2016-01-31T13:10:08Z","updated_at":"2016-01-31T13:10:08Z","html_url":"https://github.com/torchbox/wagtail/pull/2175#discussion_r51360267","pull_request_url":"https://api.github.com/repos/torchbox/wagtail/pulls/2175","_links":{"self":{"href":"https://api.github.com/repos/torchbox/wagtail/pulls/comments/51360267"},"html":{"href":"https://github.com/torchbox/wagtail/pull/2175#discussion_r51360267"},"pull_request":{"href":"https://api.github.com/repos/torchbox/wagtail/pulls/2175"}}},"pull_request":{"url":"https://api.github.com/repos/torchbox/wagtail/pulls/2175","id":57726153,"html_url":"https://github.com/torchbox/wagtail/pull/2175","diff_url":"https://github.com/torchbox/wagtail/pull/2175.diff","patch_url":"https://github.com/torchbox/wagtail/pull/2175.patch","issue_url":"https://api.github.com/repos/torchbox/wagtail/issues/2175","number":2175,"state":"open","locked":false,"title":"Added possibility to pass custom widget with editor configuration through widget attribute on RichTextField and RichTextBlock","user":{"login":"HitDaCa","id":2290450,"avatar_url":"https://avatars.githubusercontent.com/u/2290450?v=3","gravatar_id":"","url":"https://api.github.com/users/HitDaCa","html_url":"https://github.com/HitDaCa","followers_url":"https://api.github.com/users/HitDaCa/followers","following_url":"https://api.github.com/users/HitDaCa/following{/other_user}","gists_url":"https://api.github.com/users/HitDaCa/gists{/gist_id}","starred_url":"https://api.github.com/users/HitDaCa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HitDaCa/subscriptions","organizations_url":"https://api.github.com/users/HitDaCa/orgs","repos_url":"https://api.github.com/users/HitDaCa/repos","events_url":"https://api.github.com/users/HitDaCa/events{/privacy}","received_events_url":"https://api.github.com/users/HitDaCa/received_events","type":"User","site_admin":false},"body":"This pull requests replaces the original pull request [#2139](https://github.com/torchbox/wagtail/pull/2139). I had wrongly rebased to latest master before adding later changes which made code compare unusable (trying to remove rebase closed the original request).\r\n\r\nFollowing the advice from @m1kola & @JoshBarr [#2139 (comment)](https://github.com/torchbox/wagtail/pull/2139#discussion-diff-51297640), RichtTextFields and StreamField RichTextBlocks now accept a **widget** attribute. By default, if none is passed, the standard RichTextArea widget is used.\r\n\r\nFollowing @JoshBarr comment about easily configuring various RichText widgets in future, I have also moved the immutable parts of the RichTextArea into it's own abstract base class. This allows easier creation of future RichTextWidget variations.\r\n\r\n```python\r\nfrom wagtail.wagtailcore.fields import RichTextField\r\nfrom wagtail.wagtailadmin.edit_handlers import FieldPanel, StreamFieldPanel\r\n\r\nfrom wagtail.wagtailcore.blocks import RichTextBlock\r\nfrom wagtail.wagtailcore.fields import StreamField\r\n\r\nfrom wagtail.wagtailcore.fields import RichTextArea\r\n\r\nsimple_config = {\r\n    'halloheadings': {\r\n        'formatBlocks': ['p', 'h1']\r\n    },\r\n    'halloformat': {\r\n        'formattings': {\r\n            \"bold\": False,\r\n            \"italic\": False,\r\n        },\r\n    },\r\n    'hallowagtaildoclink': {},\r\n    'hallolists': {\r\n        \"lists\": {\r\n            \"ordered\": False,\r\n            \"unordered\": False\r\n        }\r\n    },\r\n    'hallowagtaillink': {},\r\n    'hallorequireparagraphs': {}\r\n}\r\n\r\ncomplex_config = {\r\n    'halloheadings': {\r\n        'formatBlocks': ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6']\r\n    },\r\n    'halloformat': {\r\n        'formattings': {\r\n            \"bold\": True,\r\n            \"italic\": True,\r\n        },\r\n    },\r\n    'hallowagtaildoclink': {},\r\n    'hallolists': {\r\n        \"lists\": {\r\n            \"ordered\": True,\r\n            \"unordered\": True\r\n        }\r\n    },\r\n    'hallowagtaillink': {},\r\n    'hallorequireparagraphs': {}\r\n}\r\n\r\nclass BookPage(Page):\r\n    book_text = RichTextField(widget=RichTextArea(editor_config=simple_config))\r\n    page_content= StreamField([\r\n        ('excerpt', RichTextBlock(required=False, widget=RichTextArea(editor_config=simple_config))),\r\n        ('paragraph', RichTextBlock(required=False, widget=RichTextArea(editor_config=complex_config)))\r\n    ])    \r\n    content_panels = Page.content_panels + [\r\n        FieldPanel('book_text', classname=\"full\"),\r\n        StreamFieldPanel('page_content')\r\n    ]\r\n```  \r\n\r\nI have also updated the RichTextField documentation and RichTextBlock documentation to explain this new attribute addition.\r\n\r\nI have added a test for the new attribute.","created_at":"2016-01-30T01:54:20Z","updated_at":"2016-01-31T13:10:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e6e6498a2840b002a2e73b1aa766f617a3648e7f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/torchbox/wagtail/pulls/2175/commits","review_comments_url":"https://api.github.com/repos/torchbox/wagtail/pulls/2175/comments","review_comment_url":"https://api.github.com/repos/torchbox/wagtail/pulls/comments{/number}","comments_url":"https://api.github.com/repos/torchbox/wagtail/issues/2175/comments","statuses_url":"https://api.github.com/repos/torchbox/wagtail/statuses/8cc7bfb75e94e6a35c0672d35c041f2bc9e82ff4","head":{"label":"HitDaCa:feature/added-widget-attrtibute-richtextarea","ref":"feature/added-widget-attrtibute-richtextarea","sha":"8cc7bfb75e94e6a35c0672d35c041f2bc9e82ff4","user":{"login":"HitDaCa","id":2290450,"avatar_url":"https://avatars.githubusercontent.com/u/2290450?v=3","gravatar_id":"","url":"https://api.github.com/users/HitDaCa","html_url":"https://github.com/HitDaCa","followers_url":"https://api.github.com/users/HitDaCa/followers","following_url":"https://api.github.com/users/HitDaCa/following{/other_user}","gists_url":"https://api.github.com/users/HitDaCa/gists{/gist_id}","starred_url":"https://api.github.com/users/HitDaCa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HitDaCa/subscriptions","organizations_url":"https://api.github.com/users/HitDaCa/orgs","repos_url":"https://api.github.com/users/HitDaCa/repos","events_url":"https://api.github.com/users/HitDaCa/events{/privacy}","received_events_url":"https://api.github.com/users/HitDaCa/received_events","type":"User","site_admin":false},"repo":{"id":50067739,"name":"wagtail","full_name":"HitDaCa/wagtail","owner":{"login":"HitDaCa","id":2290450,"avatar_url":"https://avatars.githubusercontent.com/u/2290450?v=3","gravatar_id":"","url":"https://api.github.com/users/HitDaCa","html_url":"https://github.com/HitDaCa","followers_url":"https://api.github.com/users/HitDaCa/followers","following_url":"https://api.github.com/users/HitDaCa/following{/other_user}","gists_url":"https://api.github.com/users/HitDaCa/gists{/gist_id}","starred_url":"https://api.github.com/users/HitDaCa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HitDaCa/subscriptions","organizations_url":"https://api.github.com/users/HitDaCa/orgs","repos_url":"https://api.github.com/users/HitDaCa/repos","events_url":"https://api.github.com/users/HitDaCa/events{/privacy}","received_events_url":"https://api.github.com/users/HitDaCa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/HitDaCa/wagtail","description":"A Django content management system focused on flexibility and user experience","fork":true,"url":"https://api.github.com/repos/HitDaCa/wagtail","forks_url":"https://api.github.com/repos/HitDaCa/wagtail/forks","keys_url":"https://api.github.com/repos/HitDaCa/wagtail/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HitDaCa/wagtail/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HitDaCa/wagtail/teams","hooks_url":"https://api.github.com/repos/HitDaCa/wagtail/hooks","issue_events_url":"https://api.github.com/repos/HitDaCa/wagtail/issues/events{/number}","events_url":"https://api.github.com/repos/HitDaCa/wagtail/events","assignees_url":"https://api.github.com/repos/HitDaCa/wagtail/assignees{/user}","branches_url":"https://api.github.com/repos/HitDaCa/wagtail/branches{/branch}","tags_url":"https://api.github.com/repos/HitDaCa/wagtail/tags","blobs_url":"https://api.github.com/repos/HitDaCa/wagtail/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HitDaCa/wagtail/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HitDaCa/wagtail/git/refs{/sha}","trees_url":"https://api.github.com/repos/HitDaCa/wagtail/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HitDaCa/wagtail/statuses/{sha}","languages_url":"https://api.github.com/repos/HitDaCa/wagtail/languages","stargazers_url":"https://api.github.com/repos/HitDaCa/wagtail/stargazers","contributors_url":"https://api.github.com/repos/HitDaCa/wagtail/contributors","subscribers_url":"https://api.github.com/repos/HitDaCa/wagtail/subscribers","subscription_url":"https://api.github.com/repos/HitDaCa/wagtail/subscription","commits_url":"https://api.github.com/repos/HitDaCa/wagtail/commits{/sha}","git_commits_url":"https://api.github.com/repos/HitDaCa/wagtail/git/commits{/sha}","comments_url":"https://api.github.com/repos/HitDaCa/wagtail/comments{/number}","issue_comment_url":"https://api.github.com/repos/HitDaCa/wagtail/issues/comments{/number}","contents_url":"https://api.github.com/repos/HitDaCa/wagtail/contents/{+path}","compare_url":"https://api.github.com/repos/HitDaCa/wagtail/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HitDaCa/wagtail/merges","archive_url":"https://api.github.com/repos/HitDaCa/wagtail/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HitDaCa/wagtail/downloads","issues_url":"https://api.github.com/repos/HitDaCa/wagtail/issues{/number}","pulls_url":"https://api.github.com/repos/HitDaCa/wagtail/pulls{/number}","milestones_url":"https://api.github.com/repos/HitDaCa/wagtail/milestones{/number}","notifications_url":"https://api.github.com/repos/HitDaCa/wagtail/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HitDaCa/wagtail/labels{/name}","releases_url":"https://api.github.com/repos/HitDaCa/wagtail/releases{/id}","deployments_url":"https://api.github.com/repos/HitDaCa/wagtail/deployments","created_at":"2016-01-20T23:24:21Z","updated_at":"2016-01-20T23:24:24Z","pushed_at":"2016-01-31T11:01:43Z","git_url":"git://github.com/HitDaCa/wagtail.git","ssh_url":"git@github.com:HitDaCa/wagtail.git","clone_url":"https://github.com/HitDaCa/wagtail.git","svn_url":"https://github.com/HitDaCa/wagtail","homepage":"wagtail.io","size":25143,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"torchbox:master","ref":"master","sha":"0845f1e1c1122e6ec4a9d75d488a23ed3d834554","user":{"login":"torchbox","id":84015,"avatar_url":"https://avatars.githubusercontent.com/u/84015?v=3","gravatar_id":"","url":"https://api.github.com/users/torchbox","html_url":"https://github.com/torchbox","followers_url":"https://api.github.com/users/torchbox/followers","following_url":"https://api.github.com/users/torchbox/following{/other_user}","gists_url":"https://api.github.com/users/torchbox/gists{/gist_id}","starred_url":"https://api.github.com/users/torchbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torchbox/subscriptions","organizations_url":"https://api.github.com/users/torchbox/orgs","repos_url":"https://api.github.com/users/torchbox/repos","events_url":"https://api.github.com/users/torchbox/events{/privacy}","received_events_url":"https://api.github.com/users/torchbox/received_events","type":"Organization","site_admin":false},"repo":{"id":16479108,"name":"wagtail","full_name":"torchbox/wagtail","owner":{"login":"torchbox","id":84015,"avatar_url":"https://avatars.githubusercontent.com/u/84015?v=3","gravatar_id":"","url":"https://api.github.com/users/torchbox","html_url":"https://github.com/torchbox","followers_url":"https://api.github.com/users/torchbox/followers","following_url":"https://api.github.com/users/torchbox/following{/other_user}","gists_url":"https://api.github.com/users/torchbox/gists{/gist_id}","starred_url":"https://api.github.com/users/torchbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torchbox/subscriptions","organizations_url":"https://api.github.com/users/torchbox/orgs","repos_url":"https://api.github.com/users/torchbox/repos","events_url":"https://api.github.com/users/torchbox/events{/privacy}","received_events_url":"https://api.github.com/users/torchbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/torchbox/wagtail","description":"A Django content management system focused on flexibility and user experience","fork":false,"url":"https://api.github.com/repos/torchbox/wagtail","forks_url":"https://api.github.com/repos/torchbox/wagtail/forks","keys_url":"https://api.github.com/repos/torchbox/wagtail/keys{/key_id}","collaborators_url":"https://api.github.com/repos/torchbox/wagtail/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/torchbox/wagtail/teams","hooks_url":"https://api.github.com/repos/torchbox/wagtail/hooks","issue_events_url":"https://api.github.com/repos/torchbox/wagtail/issues/events{/number}","events_url":"https://api.github.com/repos/torchbox/wagtail/events","assignees_url":"https://api.github.com/repos/torchbox/wagtail/assignees{/user}","branches_url":"https://api.github.com/repos/torchbox/wagtail/branches{/branch}","tags_url":"https://api.github.com/repos/torchbox/wagtail/tags","blobs_url":"https://api.github.com/repos/torchbox/wagtail/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/torchbox/wagtail/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/torchbox/wagtail/git/refs{/sha}","trees_url":"https://api.github.com/repos/torchbox/wagtail/git/trees{/sha}","statuses_url":"https://api.github.com/repos/torchbox/wagtail/statuses/{sha}","languages_url":"https://api.github.com/repos/torchbox/wagtail/languages","stargazers_url":"https://api.github.com/repos/torchbox/wagtail/stargazers","contributors_url":"https://api.github.com/repos/torchbox/wagtail/contributors","subscribers_url":"https://api.github.com/repos/torchbox/wagtail/subscribers","subscription_url":"https://api.github.com/repos/torchbox/wagtail/subscription","commits_url":"https://api.github.com/repos/torchbox/wagtail/commits{/sha}","git_commits_url":"https://api.github.com/repos/torchbox/wagtail/git/commits{/sha}","comments_url":"https://api.github.com/repos/torchbox/wagtail/comments{/number}","issue_comment_url":"https://api.github.com/repos/torchbox/wagtail/issues/comments{/number}","contents_url":"https://api.github.com/repos/torchbox/wagtail/contents/{+path}","compare_url":"https://api.github.com/repos/torchbox/wagtail/compare/{base}...{head}","merges_url":"https://api.github.com/repos/torchbox/wagtail/merges","archive_url":"https://api.github.com/repos/torchbox/wagtail/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/torchbox/wagtail/downloads","issues_url":"https://api.github.com/repos/torchbox/wagtail/issues{/number}","pulls_url":"https://api.github.com/repos/torchbox/wagtail/pulls{/number}","milestones_url":"https://api.github.com/repos/torchbox/wagtail/milestones{/number}","notifications_url":"https://api.github.com/repos/torchbox/wagtail/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/torchbox/wagtail/labels{/name}","releases_url":"https://api.github.com/repos/torchbox/wagtail/releases{/id}","deployments_url":"https://api.github.com/repos/torchbox/wagtail/deployments","created_at":"2014-02-03T12:41:59Z","updated_at":"2016-01-31T03:27:10Z","pushed_at":"2016-01-31T11:01:43Z","git_url":"git://github.com/torchbox/wagtail.git","ssh_url":"git@github.com:torchbox/wagtail.git","clone_url":"https://github.com/torchbox/wagtail.git","svn_url":"https://github.com/torchbox/wagtail","homepage":"wagtail.io","size":32295,"stargazers_count":3233,"watchers_count":3233,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":541,"mirror_url":null,"open_issues_count":360,"forks":541,"open_issues":360,"watchers":3233,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/torchbox/wagtail/pulls/2175"},"html":{"href":"https://github.com/torchbox/wagtail/pull/2175"},"issue":{"href":"https://api.github.com/repos/torchbox/wagtail/issues/2175"},"comments":{"href":"https://api.github.com/repos/torchbox/wagtail/issues/2175/comments"},"review_comments":{"href":"https://api.github.com/repos/torchbox/wagtail/pulls/2175/comments"},"review_comment":{"href":"https://api.github.com/repos/torchbox/wagtail/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/torchbox/wagtail/pulls/2175/commits"},"statuses":{"href":"https://api.github.com/repos/torchbox/wagtail/statuses/8cc7bfb75e94e6a35c0672d35c041f2bc9e82ff4"}}}}