{"action":"created","comment":{"url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/pulls/comments/234630754","pull_request_review_id":176266434,"id":234630754,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNDYzMDc1NA==","diff_hunk":"@@ -0,0 +1,108 @@\n+\"\"\"Tests for views' Blog app.\"\"\"\n+\n+from datetime import datetime\n+\n+from django.contrib.auth.models import User\n+from django.test import TestCase\n+from django.urls import reverse\n+\n+from ..models import Post\n+\n+\n+class PostListTest(TestCase):\n+    \"\"\"Tests for Post views.\"\"\"\n+\n+    def setUp(self):\n+        \"\"\"Set up non-modifiable objects used by all test methods.\"\"\"\n+        bob = User.objects.create(username='bob')\n+        self.post_first = Post.objects.create(\n+            author=bob,\n+            title='Title Bob',\n+            text='Text bob',\n+            published_date=datetime(day=8, month=11, year=2018),\n+        )\n+\n+        john = User.objects.create(username='john')\n+\n+        self.post_second = Post.objects.create(\n+            author=john, title='Title John', text='Text John'\n+        )\n+        self.post_third = Post.objects.create(\n+            author=john, title='Title John 2', text='Text John 2'\n+        )\n+        self.post_third.publish()\n+\n+    def tearDown(self):\n+        \"\"\"Clean-up test data.\"\"\"\n+        del self.post_first\n+        del self.post_second\n+        del self.post_third\n+\n+    def test_post_list(self):\n+        \"\"\"Test show post list on the page.\"\"\"\n+        response = self.client.get(reverse('post_list'))\n+        self.assertEqual(response.status_code, 200)\n+\n+        self.assertTemplateUsed(\n+            response, 'blog/post_list.html', 'blog/base.html'\n+        )\n+        self.assertEqual(len(response.context['posts']), 2)\n+\n+    def test_post_detail(self):\n+        \"\"\"Test post detail.\"\"\"\n+        response = self.client.get(reverse('post_detail', kwargs={'pk': 1}))\n+        self.assertEqual(response.status_code, 200)\n+\n+        self.assertTemplateUsed(\n+            response, 'blog/post_detail.html', 'blog/base.html'\n+        )\n+\n+        self.assertIn(b'Title Bob', response.content)\n+        self.assertIn(b'Text bob', response.content)\n+\n+        self.assertEqual(str(response.context['post']), 'Title Bob')\n+\n+    def test_post_new_and_edit(self):\n+        \"\"\"Test create and edit post.\"\"\"\n+        response = self.client.get(reverse('post_new'))\n+        self.assertEqual(response.status_code, 200)\n+\n+        paul_password = 'test'\n+        paul = User.objects.create_superuser(\n+            username='paul', password=paul_password, email='e@e.com'\n+        )\n+        self.client.login(username=paul.username, password=paul_password)\n+\n+        response = self.client.post(\n+            reverse('post_new'),\n+            {\n+                'author': paul,","path":"blog/tests/views_test.py","position":79,"original_position":79,"commit_id":"b9613f1f26f4e214386a9fe8c70ab9369bb122c5","original_commit_id":"b9613f1f26f4e214386a9fe8c70ab9369bb122c5","user":{"login":"webknjaz","id":578543,"node_id":"MDQ6VXNlcjU3ODU0Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/578543?v=4","gravatar_id":"","url":"https://api.github.com/users/webknjaz","html_url":"https://github.com/webknjaz","followers_url":"https://api.github.com/users/webknjaz/followers","following_url":"https://api.github.com/users/webknjaz/following{/other_user}","gists_url":"https://api.github.com/users/webknjaz/gists{/gist_id}","starred_url":"https://api.github.com/users/webknjaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webknjaz/subscriptions","organizations_url":"https://api.github.com/users/webknjaz/orgs","repos_url":"https://api.github.com/users/webknjaz/repos","events_url":"https://api.github.com/users/webknjaz/events{/privacy}","received_events_url":"https://api.github.com/users/webknjaz/received_events","type":"User","site_admin":false},"body":"You should probably use a string value, not some object.","created_at":"2018-11-19T14:10:31Z","updated_at":"2018-11-19T14:12:54Z","html_url":"https://github.com/kpi-web-guild/django-girls-blog-serhii73/pull/42#discussion_r234630754","pull_request_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/pulls/42","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/pulls/comments/234630754"},"html":{"href":"https://github.com/kpi-web-guild/django-girls-blog-serhii73/pull/42#discussion_r234630754"},"pull_request":{"href":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/pulls/42"}}},"pull_request":{"url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/pulls/42","id":208513189,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA4NTEzMTg5","html_url":"https://github.com/kpi-web-guild/django-girls-blog-serhii73/pull/42","diff_url":"https://github.com/kpi-web-guild/django-girls-blog-serhii73/pull/42.diff","patch_url":"https://github.com/kpi-web-guild/django-girls-blog-serhii73/pull/42.patch","issue_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/issues/42","number":42,"state":"open","locked":false,"title":"Feature/create unit tests","user":{"login":"serhii73","id":24910277,"node_id":"MDQ6VXNlcjI0OTEwMjc3","avatar_url":"https://avatars1.githubusercontent.com/u/24910277?v=4","gravatar_id":"","url":"https://api.github.com/users/serhii73","html_url":"https://github.com/serhii73","followers_url":"https://api.github.com/users/serhii73/followers","following_url":"https://api.github.com/users/serhii73/following{/other_user}","gists_url":"https://api.github.com/users/serhii73/gists{/gist_id}","starred_url":"https://api.github.com/users/serhii73/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serhii73/subscriptions","organizations_url":"https://api.github.com/users/serhii73/orgs","repos_url":"https://api.github.com/users/serhii73/repos","events_url":"https://api.github.com/users/serhii73/events{/privacy}","received_events_url":"https://api.github.com/users/serhii73/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-08-15T09:23:07Z","updated_at":"2018-11-19T14:12:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4ad632c26ab3cc07e14bfd52e6bbcc085015b0d3","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/pulls/42/commits","review_comments_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/pulls/42/comments","review_comment_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/issues/42/comments","statuses_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/statuses/b9613f1f26f4e214386a9fe8c70ab9369bb122c5","head":{"label":"kpi-web-guild:feature/create_unit_tests","ref":"feature/create_unit_tests","sha":"b9613f1f26f4e214386a9fe8c70ab9369bb122c5","user":{"login":"kpi-web-guild","id":23158073,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMTU4MDcz","avatar_url":"https://avatars2.githubusercontent.com/u/23158073?v=4","gravatar_id":"","url":"https://api.github.com/users/kpi-web-guild","html_url":"https://github.com/kpi-web-guild","followers_url":"https://api.github.com/users/kpi-web-guild/followers","following_url":"https://api.github.com/users/kpi-web-guild/following{/other_user}","gists_url":"https://api.github.com/users/kpi-web-guild/gists{/gist_id}","starred_url":"https://api.github.com/users/kpi-web-guild/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kpi-web-guild/subscriptions","organizations_url":"https://api.github.com/users/kpi-web-guild/orgs","repos_url":"https://api.github.com/users/kpi-web-guild/repos","events_url":"https://api.github.com/users/kpi-web-guild/events{/privacy}","received_events_url":"https://api.github.com/users/kpi-web-guild/received_events","type":"Organization","site_admin":false},"repo":{"id":134327781,"node_id":"MDEwOlJlcG9zaXRvcnkxMzQzMjc3ODE=","name":"django-girls-blog-serhii73","full_name":"kpi-web-guild/django-girls-blog-serhii73","private":false,"owner":{"login":"kpi-web-guild","id":23158073,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMTU4MDcz","avatar_url":"https://avatars2.githubusercontent.com/u/23158073?v=4","gravatar_id":"","url":"https://api.github.com/users/kpi-web-guild","html_url":"https://github.com/kpi-web-guild","followers_url":"https://api.github.com/users/kpi-web-guild/followers","following_url":"https://api.github.com/users/kpi-web-guild/following{/other_user}","gists_url":"https://api.github.com/users/kpi-web-guild/gists{/gist_id}","starred_url":"https://api.github.com/users/kpi-web-guild/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kpi-web-guild/subscriptions","organizations_url":"https://api.github.com/users/kpi-web-guild/orgs","repos_url":"https://api.github.com/users/kpi-web-guild/repos","events_url":"https://api.github.com/users/kpi-web-guild/events{/privacy}","received_events_url":"https://api.github.com/users/kpi-web-guild/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/kpi-web-guild/django-girls-blog-serhii73","description":"django-girls-blog-serhii73 created by GitHub Classroom","fork":false,"url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73","forks_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/forks","keys_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/teams","hooks_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/hooks","issue_events_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/issues/events{/number}","events_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/events","assignees_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/assignees{/user}","branches_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/branches{/branch}","tags_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/tags","blobs_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/git/refs{/sha}","trees_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/statuses/{sha}","languages_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/languages","stargazers_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/stargazers","contributors_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/contributors","subscribers_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/subscribers","subscription_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/subscription","commits_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/commits{/sha}","git_commits_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/git/commits{/sha}","comments_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/comments{/number}","issue_comment_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/issues/comments{/number}","contents_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/contents/{+path}","compare_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/merges","archive_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/downloads","issues_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/issues{/number}","pulls_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/pulls{/number}","milestones_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/milestones{/number}","notifications_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/labels{/name}","releases_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/releases{/id}","deployments_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/deployments","created_at":"2018-05-21T21:36:02Z","updated_at":"2018-10-23T07:52:58Z","pushed_at":"2018-11-19T09:54:24Z","git_url":"git://github.com/kpi-web-guild/django-girls-blog-serhii73.git","ssh_url":"git@github.com:kpi-web-guild/django-girls-blog-serhii73.git","clone_url":"https://github.com/kpi-web-guild/django-girls-blog-serhii73.git","svn_url":"https://github.com/kpi-web-guild/django-girls-blog-serhii73","homepage":null,"size":43,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":7,"watchers":0,"default_branch":"master"}},"base":{"label":"kpi-web-guild:master","ref":"master","sha":"c98facfddf445e9924656f621a45037a7a8a44fc","user":{"login":"kpi-web-guild","id":23158073,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMTU4MDcz","avatar_url":"https://avatars2.githubusercontent.com/u/23158073?v=4","gravatar_id":"","url":"https://api.github.com/users/kpi-web-guild","html_url":"https://github.com/kpi-web-guild","followers_url":"https://api.github.com/users/kpi-web-guild/followers","following_url":"https://api.github.com/users/kpi-web-guild/following{/other_user}","gists_url":"https://api.github.com/users/kpi-web-guild/gists{/gist_id}","starred_url":"https://api.github.com/users/kpi-web-guild/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kpi-web-guild/subscriptions","organizations_url":"https://api.github.com/users/kpi-web-guild/orgs","repos_url":"https://api.github.com/users/kpi-web-guild/repos","events_url":"https://api.github.com/users/kpi-web-guild/events{/privacy}","received_events_url":"https://api.github.com/users/kpi-web-guild/received_events","type":"Organization","site_admin":false},"repo":{"id":134327781,"node_id":"MDEwOlJlcG9zaXRvcnkxMzQzMjc3ODE=","name":"django-girls-blog-serhii73","full_name":"kpi-web-guild/django-girls-blog-serhii73","private":false,"owner":{"login":"kpi-web-guild","id":23158073,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMTU4MDcz","avatar_url":"https://avatars2.githubusercontent.com/u/23158073?v=4","gravatar_id":"","url":"https://api.github.com/users/kpi-web-guild","html_url":"https://github.com/kpi-web-guild","followers_url":"https://api.github.com/users/kpi-web-guild/followers","following_url":"https://api.github.com/users/kpi-web-guild/following{/other_user}","gists_url":"https://api.github.com/users/kpi-web-guild/gists{/gist_id}","starred_url":"https://api.github.com/users/kpi-web-guild/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kpi-web-guild/subscriptions","organizations_url":"https://api.github.com/users/kpi-web-guild/orgs","repos_url":"https://api.github.com/users/kpi-web-guild/repos","events_url":"https://api.github.com/users/kpi-web-guild/events{/privacy}","received_events_url":"https://api.github.com/users/kpi-web-guild/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/kpi-web-guild/django-girls-blog-serhii73","description":"django-girls-blog-serhii73 created by GitHub Classroom","fork":false,"url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73","forks_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/forks","keys_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/teams","hooks_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/hooks","issue_events_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/issues/events{/number}","events_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/events","assignees_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/assignees{/user}","branches_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/branches{/branch}","tags_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/tags","blobs_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/git/refs{/sha}","trees_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/statuses/{sha}","languages_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/languages","stargazers_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/stargazers","contributors_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/contributors","subscribers_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/subscribers","subscription_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/subscription","commits_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/commits{/sha}","git_commits_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/git/commits{/sha}","comments_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/comments{/number}","issue_comment_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/issues/comments{/number}","contents_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/contents/{+path}","compare_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/merges","archive_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/downloads","issues_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/issues{/number}","pulls_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/pulls{/number}","milestones_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/milestones{/number}","notifications_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/labels{/name}","releases_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/releases{/id}","deployments_url":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/deployments","created_at":"2018-05-21T21:36:02Z","updated_at":"2018-10-23T07:52:58Z","pushed_at":"2018-11-19T09:54:24Z","git_url":"git://github.com/kpi-web-guild/django-girls-blog-serhii73.git","ssh_url":"git@github.com:kpi-web-guild/django-girls-blog-serhii73.git","clone_url":"https://github.com/kpi-web-guild/django-girls-blog-serhii73.git","svn_url":"https://github.com/kpi-web-guild/django-girls-blog-serhii73","homepage":null,"size":43,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1,"open_issues":7,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/pulls/42"},"html":{"href":"https://github.com/kpi-web-guild/django-girls-blog-serhii73/pull/42"},"issue":{"href":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/issues/42"},"comments":{"href":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/issues/42/comments"},"review_comments":{"href":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/pulls/42/comments"},"review_comment":{"href":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/pulls/42/commits"},"statuses":{"href":"https://api.github.com/repos/kpi-web-guild/django-girls-blog-serhii73/statuses/b9613f1f26f4e214386a9fe8c70ab9369bb122c5"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"webknjaz"}}