{"action":"created","comment":{"url":"https://api.github.com/repos/django/django/pulls/comments/31870524","id":31870524,"diff_hunk":"@@ -2274,11 +2274,50 @@ class SomeForm(Form):\n             some_field = CharField()\n \n             def as_p(self):\n-                return self._html_output('<p id=\"p_%(field_name)s\"></p>', '%s', '</p>', ' %s', True)\n+                return self._html_output(\n+                    normal_row='<p id=\"p_%(field_name)s\"></p>',\n+                    error_row='%s',\n+                    row_ender='</p>',\n+                    help_text_html=' %s',\n+                    errors_on_separate_row=True,\n+                )\n \n         form = SomeForm()\n         self.assertHTMLEqual(form.as_p(), '<p id=\"p_some_field\"></p>')\n \n+    def test_field_without_css_classes(self):\n+        class SomeForm(Form):\n+            some_field = CharField()\n+\n+            def as_p(self):\n+                return self._html_output(\n+                    normal_row='<p class=\"%(css_classes)s\"></p>',\n+                    error_row='%s',\n+                    row_ender='</p>',\n+                    help_text_html=' %s',\n+                    errors_on_separate_row=True,\n+                )\n+\n+        form = SomeForm()\n+        self.assertHTMLEqual(form.as_p(), '<p class=\"\"></p>')\n+\n+    def test_field_with_css_class(self):\n+        class SomeForm(Form):\n+            some_field = CharField(widget=TextInput(attrs={'class': 'first_name_id'}))","path":"tests/forms_tests/tests/test_forms.py","position":34,"original_position":34,"commit_id":"4761f3e41ee418a54be7c4c04348cb053189eae7","original_commit_id":"4761f3e41ee418a54be7c4c04348cb053189eae7","user":{"login":"timgraham","id":411869,"avatar_url":"https://avatars.githubusercontent.com/u/411869?v=3","gravatar_id":"","url":"https://api.github.com/users/timgraham","html_url":"https://github.com/timgraham","followers_url":"https://api.github.com/users/timgraham/followers","following_url":"https://api.github.com/users/timgraham/following{/other_user}","gists_url":"https://api.github.com/users/timgraham/gists{/gist_id}","starred_url":"https://api.github.com/users/timgraham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timgraham/subscriptions","organizations_url":"https://api.github.com/users/timgraham/orgs","repos_url":"https://api.github.com/users/timgraham/repos","events_url":"https://api.github.com/users/timgraham/events{/privacy}","received_events_url":"https://api.github.com/users/timgraham/received_events","type":"User","site_admin":false},"body":"is `widget=...` important for the test?","created_at":"2015-06-06T18:55:59Z","updated_at":"2015-06-06T18:55:59Z","html_url":"https://github.com/django/django/pull/4819#discussion_r31870524","pull_request_url":"https://api.github.com/repos/django/django/pulls/4819","_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/comments/31870524"},"html":{"href":"https://github.com/django/django/pull/4819#discussion_r31870524"},"pull_request":{"href":"https://api.github.com/repos/django/django/pulls/4819"}}},"pull_request":{"url":"https://api.github.com/repos/django/django/pulls/4819","id":37077283,"html_url":"https://github.com/django/django/pull/4819","diff_url":"https://github.com/django/django/pull/4819.diff","patch_url":"https://github.com/django/django/pull/4819.patch","issue_url":"https://api.github.com/repos/django/django/issues/4819","number":4819,"state":"open","locked":false,"title":"Fixed #12437 -- Added css_classes to Form._html_output().","user":{"login":"alimony","id":331091,"avatar_url":"https://avatars.githubusercontent.com/u/331091?v=3","gravatar_id":"","url":"https://api.github.com/users/alimony","html_url":"https://github.com/alimony","followers_url":"https://api.github.com/users/alimony/followers","following_url":"https://api.github.com/users/alimony/following{/other_user}","gists_url":"https://api.github.com/users/alimony/gists{/gist_id}","starred_url":"https://api.github.com/users/alimony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alimony/subscriptions","organizations_url":"https://api.github.com/users/alimony/orgs","repos_url":"https://api.github.com/users/alimony/repos","events_url":"https://api.github.com/users/alimony/events{/privacy}","received_events_url":"https://api.github.com/users/alimony/received_events","type":"User","site_admin":false},"body":"See ticket: https://code.djangoproject.com/ticket/12437","created_at":"2015-06-05T22:57:13Z","updated_at":"2015-06-06T18:55:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8a69a72bcb1a5a7f4b6659968f7be7ab15730a87","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/django/django/pulls/4819/commits","review_comments_url":"https://api.github.com/repos/django/django/pulls/4819/comments","review_comment_url":"https://api.github.com/repos/django/django/pulls/comments{/number}","comments_url":"https://api.github.com/repos/django/django/issues/4819/comments","statuses_url":"https://api.github.com/repos/django/django/statuses/4761f3e41ee418a54be7c4c04348cb053189eae7","head":{"label":"alimony:css_classes_form_html","ref":"css_classes_form_html","sha":"4761f3e41ee418a54be7c4c04348cb053189eae7","user":{"login":"alimony","id":331091,"avatar_url":"https://avatars.githubusercontent.com/u/331091?v=3","gravatar_id":"","url":"https://api.github.com/users/alimony","html_url":"https://github.com/alimony","followers_url":"https://api.github.com/users/alimony/followers","following_url":"https://api.github.com/users/alimony/following{/other_user}","gists_url":"https://api.github.com/users/alimony/gists{/gist_id}","starred_url":"https://api.github.com/users/alimony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alimony/subscriptions","organizations_url":"https://api.github.com/users/alimony/orgs","repos_url":"https://api.github.com/users/alimony/repos","events_url":"https://api.github.com/users/alimony/events{/privacy}","received_events_url":"https://api.github.com/users/alimony/received_events","type":"User","site_admin":false},"repo":{"id":36766524,"name":"django","full_name":"alimony/django","owner":{"login":"alimony","id":331091,"avatar_url":"https://avatars.githubusercontent.com/u/331091?v=3","gravatar_id":"","url":"https://api.github.com/users/alimony","html_url":"https://github.com/alimony","followers_url":"https://api.github.com/users/alimony/followers","following_url":"https://api.github.com/users/alimony/following{/other_user}","gists_url":"https://api.github.com/users/alimony/gists{/gist_id}","starred_url":"https://api.github.com/users/alimony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alimony/subscriptions","organizations_url":"https://api.github.com/users/alimony/orgs","repos_url":"https://api.github.com/users/alimony/repos","events_url":"https://api.github.com/users/alimony/events{/privacy}","received_events_url":"https://api.github.com/users/alimony/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alimony/django","description":"The Web framework for perfectionists with deadlines.","fork":true,"url":"https://api.github.com/repos/alimony/django","forks_url":"https://api.github.com/repos/alimony/django/forks","keys_url":"https://api.github.com/repos/alimony/django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alimony/django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alimony/django/teams","hooks_url":"https://api.github.com/repos/alimony/django/hooks","issue_events_url":"https://api.github.com/repos/alimony/django/issues/events{/number}","events_url":"https://api.github.com/repos/alimony/django/events","assignees_url":"https://api.github.com/repos/alimony/django/assignees{/user}","branches_url":"https://api.github.com/repos/alimony/django/branches{/branch}","tags_url":"https://api.github.com/repos/alimony/django/tags","blobs_url":"https://api.github.com/repos/alimony/django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alimony/django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alimony/django/git/refs{/sha}","trees_url":"https://api.github.com/repos/alimony/django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alimony/django/statuses/{sha}","languages_url":"https://api.github.com/repos/alimony/django/languages","stargazers_url":"https://api.github.com/repos/alimony/django/stargazers","contributors_url":"https://api.github.com/repos/alimony/django/contributors","subscribers_url":"https://api.github.com/repos/alimony/django/subscribers","subscription_url":"https://api.github.com/repos/alimony/django/subscription","commits_url":"https://api.github.com/repos/alimony/django/commits{/sha}","git_commits_url":"https://api.github.com/repos/alimony/django/git/commits{/sha}","comments_url":"https://api.github.com/repos/alimony/django/comments{/number}","issue_comment_url":"https://api.github.com/repos/alimony/django/issues/comments{/number}","contents_url":"https://api.github.com/repos/alimony/django/contents/{+path}","compare_url":"https://api.github.com/repos/alimony/django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alimony/django/merges","archive_url":"https://api.github.com/repos/alimony/django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alimony/django/downloads","issues_url":"https://api.github.com/repos/alimony/django/issues{/number}","pulls_url":"https://api.github.com/repos/alimony/django/pulls{/number}","milestones_url":"https://api.github.com/repos/alimony/django/milestones{/number}","notifications_url":"https://api.github.com/repos/alimony/django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alimony/django/labels{/name}","releases_url":"https://api.github.com/repos/alimony/django/releases{/id}","created_at":"2015-06-02T22:52:47Z","updated_at":"2015-06-02T22:53:01Z","pushed_at":"2015-06-06T11:02:06Z","git_url":"git://github.com/alimony/django.git","ssh_url":"git@github.com:alimony/django.git","clone_url":"https://github.com/alimony/django.git","svn_url":"https://github.com/alimony/django","homepage":"https://www.djangoproject.com/","size":140604,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"django:master","ref":"master","sha":"7abf418eb12471c86e97f68d58f966598d9fc86b","user":{"login":"django","id":27804,"avatar_url":"https://avatars.githubusercontent.com/u/27804?v=3","gravatar_id":"","url":"https://api.github.com/users/django","html_url":"https://github.com/django","followers_url":"https://api.github.com/users/django/followers","following_url":"https://api.github.com/users/django/following{/other_user}","gists_url":"https://api.github.com/users/django/gists{/gist_id}","starred_url":"https://api.github.com/users/django/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django/subscriptions","organizations_url":"https://api.github.com/users/django/orgs","repos_url":"https://api.github.com/users/django/repos","events_url":"https://api.github.com/users/django/events{/privacy}","received_events_url":"https://api.github.com/users/django/received_events","type":"Organization","site_admin":false},"repo":{"id":4164482,"name":"django","full_name":"django/django","owner":{"login":"django","id":27804,"avatar_url":"https://avatars.githubusercontent.com/u/27804?v=3","gravatar_id":"","url":"https://api.github.com/users/django","html_url":"https://github.com/django","followers_url":"https://api.github.com/users/django/followers","following_url":"https://api.github.com/users/django/following{/other_user}","gists_url":"https://api.github.com/users/django/gists{/gist_id}","starred_url":"https://api.github.com/users/django/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django/subscriptions","organizations_url":"https://api.github.com/users/django/orgs","repos_url":"https://api.github.com/users/django/repos","events_url":"https://api.github.com/users/django/events{/privacy}","received_events_url":"https://api.github.com/users/django/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/django/django","description":"The Web framework for perfectionists with deadlines.","fork":false,"url":"https://api.github.com/repos/django/django","forks_url":"https://api.github.com/repos/django/django/forks","keys_url":"https://api.github.com/repos/django/django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/django/django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/django/django/teams","hooks_url":"https://api.github.com/repos/django/django/hooks","issue_events_url":"https://api.github.com/repos/django/django/issues/events{/number}","events_url":"https://api.github.com/repos/django/django/events","assignees_url":"https://api.github.com/repos/django/django/assignees{/user}","branches_url":"https://api.github.com/repos/django/django/branches{/branch}","tags_url":"https://api.github.com/repos/django/django/tags","blobs_url":"https://api.github.com/repos/django/django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/django/django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/django/django/git/refs{/sha}","trees_url":"https://api.github.com/repos/django/django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/django/django/statuses/{sha}","languages_url":"https://api.github.com/repos/django/django/languages","stargazers_url":"https://api.github.com/repos/django/django/stargazers","contributors_url":"https://api.github.com/repos/django/django/contributors","subscribers_url":"https://api.github.com/repos/django/django/subscribers","subscription_url":"https://api.github.com/repos/django/django/subscription","commits_url":"https://api.github.com/repos/django/django/commits{/sha}","git_commits_url":"https://api.github.com/repos/django/django/git/commits{/sha}","comments_url":"https://api.github.com/repos/django/django/comments{/number}","issue_comment_url":"https://api.github.com/repos/django/django/issues/comments{/number}","contents_url":"https://api.github.com/repos/django/django/contents/{+path}","compare_url":"https://api.github.com/repos/django/django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/django/django/merges","archive_url":"https://api.github.com/repos/django/django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/django/django/downloads","issues_url":"https://api.github.com/repos/django/django/issues{/number}","pulls_url":"https://api.github.com/repos/django/django/pulls{/number}","milestones_url":"https://api.github.com/repos/django/django/milestones{/number}","notifications_url":"https://api.github.com/repos/django/django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/django/django/labels{/name}","releases_url":"https://api.github.com/repos/django/django/releases{/id}","created_at":"2012-04-28T02:47:18Z","updated_at":"2015-06-06T18:29:56Z","pushed_at":"2015-06-06T18:37:17Z","git_url":"git://github.com/django/django.git","ssh_url":"git@github.com:django/django.git","clone_url":"https://github.com/django/django.git","svn_url":"https://github.com/django/django","homepage":"https://www.djangoproject.com/","size":292595,"stargazers_count":14527,"watchers_count":14527,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5809,"mirror_url":null,"open_issues_count":92,"forks":5809,"open_issues":92,"watchers":14527,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/4819"},"html":{"href":"https://github.com/django/django/pull/4819"},"issue":{"href":"https://api.github.com/repos/django/django/issues/4819"},"comments":{"href":"https://api.github.com/repos/django/django/issues/4819/comments"},"review_comments":{"href":"https://api.github.com/repos/django/django/pulls/4819/comments"},"review_comment":{"href":"https://api.github.com/repos/django/django/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/django/django/pulls/4819/commits"},"statuses":{"href":"https://api.github.com/repos/django/django/statuses/4761f3e41ee418a54be7c4c04348cb053189eae7"}}}}