{"action":"created","comment":{"url":"https://api.github.com/repos/andela/codango/pulls/comments/87781361","pull_request_review_id":8351846,"id":87781361,"diff_hunk":"@@ -1,83 +1,68 @@\n-from django.contrib.auth.models import User\n from django.core.exceptions import ObjectDoesNotExist\n from django.test import TestCase\n-from ..models import Community, Tag, AddOn\n+\n+from community.models import AddOn, Community\n+from factories import AddOnFactory, CommunityFactory, UserFactory\n \n \n class AddonModelTestSuite(TestCase):\n     def setUp(self):\n-        self.user = User.objects.create(\n-            username=\"regularjoe\",\n-            email=\"regularjoe@yahoo.com\",\n-            password=\"regularjoepass\"\n-        )\n-\n-        tag = Tag.objects.create(title=\"Python\")\n-        self.community_python = Community.objects.create(\n-            name=\"pythonistas\",\n-            description=\"A chill place for python lovers\",\n-            creator=self.user\n-        )\n-        self.community_python.tags.add(tag)\n-        self.community_ruby = Community.objects.create(\n-            name=\"Ruby Tabernacle\",\n-            description=\"We eat gems and talk ruby\",\n-            creator=self.user\n-        )\n-        self.community_ruby.tags.add(tag)\n-\n-        self.addon_statistics = AddOn.objects.create(name=\"statistics\")\n-        self.addon_bots = AddOn.objects.create(name=\"bots\")\n-        self.addon_statistics.communities.add(self.community_python)\n+        self.addons = AddOnFactory.build_batch(2)\n+        self.communities = CommunityFactory.create()\n+        self.addon = AddOn.objects.create(name=self.addons[0].name)\n \n     def test_can_create_addon(self):\n-        addon = AddOn.objects.create(name=\"pairprogram\")\n-        self.assertIsInstance(addon, AddOn)\n-        self.assertIsNotNone(addon.id)\n-        self.assertIsNotNone(addon.name)\n+        self.assertIsInstance(self.addon, AddOn)","path":"codango/community/tests/test_models.py","position":44,"original_position":44,"commit_id":"3a848b661daaa0a49395190b9c4fcdcfe93e89f3","original_commit_id":"3a848b661daaa0a49395190b9c4fcdcfe93e89f3","user":{"login":"andela-cobiora","id":8373338,"avatar_url":"https://avatars.githubusercontent.com/u/8373338?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-cobiora","html_url":"https://github.com/andela-cobiora","followers_url":"https://api.github.com/users/andela-cobiora/followers","following_url":"https://api.github.com/users/andela-cobiora/following{/other_user}","gists_url":"https://api.github.com/users/andela-cobiora/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-cobiora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-cobiora/subscriptions","organizations_url":"https://api.github.com/users/andela-cobiora/orgs","repos_url":"https://api.github.com/users/andela-cobiora/repos","events_url":"https://api.github.com/users/andela-cobiora/events{/privacy}","received_events_url":"https://api.github.com/users/andela-cobiora/received_events","type":"User","site_admin":false},"body":"This test is redundant because of line 12","created_at":"2016-11-14T11:19:49Z","updated_at":"2016-11-14T11:31:13Z","html_url":"https://github.com/andela/codango/pull/169#discussion_r87781361","pull_request_url":"https://api.github.com/repos/andela/codango/pulls/169","_links":{"self":{"href":"https://api.github.com/repos/andela/codango/pulls/comments/87781361"},"html":{"href":"https://github.com/andela/codango/pull/169#discussion_r87781361"},"pull_request":{"href":"https://api.github.com/repos/andela/codango/pulls/169"}}},"pull_request":{"url":"https://api.github.com/repos/andela/codango/pulls/169","id":93520661,"html_url":"https://github.com/andela/codango/pull/169","diff_url":"https://github.com/andela/codango/pull/169.diff","patch_url":"https://github.com/andela/codango/pull/169.patch","issue_url":"https://api.github.com/repos/andela/codango/issues/169","number":169,"state":"open","locked":false,"title":"#132569383 Ft create factories for half of the models ","user":{"login":"andela-landia","id":20776933,"avatar_url":"https://avatars.githubusercontent.com/u/20776933?v=3","gravatar_id":"","url":"https://api.github.com/users/andela-landia","html_url":"https://github.com/andela-landia","followers_url":"https://api.github.com/users/andela-landia/followers","following_url":"https://api.github.com/users/andela-landia/following{/other_user}","gists_url":"https://api.github.com/users/andela-landia/gists{/gist_id}","starred_url":"https://api.github.com/users/andela-landia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela-landia/subscriptions","organizations_url":"https://api.github.com/users/andela-landia/orgs","repos_url":"https://api.github.com/users/andela-landia/repos","events_url":"https://api.github.com/users/andela-landia/events{/privacy}","received_events_url":"https://api.github.com/users/andela-landia/received_events","type":"User","site_admin":false},"body":"## What does this PR do?\r\n\r\nCreate factories for models (Comments, Community, Resources, Votes) and refactor the models tests.\r\n## Description of Task to be completed?\r\n\r\nCreate factories for models and refactor the affected tests\r\n## How should this be manually tested?\r\n\r\nClone the branch `git clone https://github.com/andela/codango.git`\r\nInstall the requirements `pip install requirements.txt`\r\nNavigate into the directory `cd codango`\r\nRun the  tests `python manage.py test`\r\n\r\n## What are the relevant pivotal tracker stories?\r\n\r\n#132569383 - Create factories for models (1/2)\r\n","created_at":"2016-11-14T07:42:24Z","updated_at":"2016-11-14T11:31:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8eeef8413565a8bf77ef2fe3e59f01d77657bfa1","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/andela/codango/pulls/169/commits","review_comments_url":"https://api.github.com/repos/andela/codango/pulls/169/comments","review_comment_url":"https://api.github.com/repos/andela/codango/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andela/codango/issues/169/comments","statuses_url":"https://api.github.com/repos/andela/codango/statuses/3a848b661daaa0a49395190b9c4fcdcfe93e89f3","head":{"label":"andela:ft-create-factories-for-half-of-the-models-132569383","ref":"ft-create-factories-for-half-of-the-models-132569383","sha":"3a848b661daaa0a49395190b9c4fcdcfe93e89f3","user":{"login":"andela","id":4100206,"avatar_url":"https://avatars.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":40593971,"name":"codango","full_name":"andela/codango","owner":{"login":"andela","id":4100206,"avatar_url":"https://avatars.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/andela/codango","description":"Social Network for Coders","fork":false,"url":"https://api.github.com/repos/andela/codango","forks_url":"https://api.github.com/repos/andela/codango/forks","keys_url":"https://api.github.com/repos/andela/codango/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/codango/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/codango/teams","hooks_url":"https://api.github.com/repos/andela/codango/hooks","issue_events_url":"https://api.github.com/repos/andela/codango/issues/events{/number}","events_url":"https://api.github.com/repos/andela/codango/events","assignees_url":"https://api.github.com/repos/andela/codango/assignees{/user}","branches_url":"https://api.github.com/repos/andela/codango/branches{/branch}","tags_url":"https://api.github.com/repos/andela/codango/tags","blobs_url":"https://api.github.com/repos/andela/codango/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/codango/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/codango/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/codango/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/codango/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/codango/languages","stargazers_url":"https://api.github.com/repos/andela/codango/stargazers","contributors_url":"https://api.github.com/repos/andela/codango/contributors","subscribers_url":"https://api.github.com/repos/andela/codango/subscribers","subscription_url":"https://api.github.com/repos/andela/codango/subscription","commits_url":"https://api.github.com/repos/andela/codango/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/codango/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/codango/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/codango/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/codango/contents/{+path}","compare_url":"https://api.github.com/repos/andela/codango/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/codango/merges","archive_url":"https://api.github.com/repos/andela/codango/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/codango/downloads","issues_url":"https://api.github.com/repos/andela/codango/issues{/number}","pulls_url":"https://api.github.com/repos/andela/codango/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/codango/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/codango/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/codango/labels{/name}","releases_url":"https://api.github.com/repos/andela/codango/releases{/id}","deployments_url":"https://api.github.com/repos/andela/codango/deployments","created_at":"2015-08-12T10:04:41Z","updated_at":"2016-10-24T12:39:56Z","pushed_at":"2016-11-14T09:41:07Z","git_url":"git://github.com/andela/codango.git","ssh_url":"git@github.com:andela/codango.git","clone_url":"https://github.com/andela/codango.git","svn_url":"https://github.com/andela/codango","homepage":"","size":38790,"stargazers_count":8,"watchers_count":8,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":2,"forks":6,"open_issues":2,"watchers":8,"default_branch":"develop"}},"base":{"label":"andela:develop","ref":"develop","sha":"e8c6baa9e80f99b65d5cc3a673598683b1d6fb9c","user":{"login":"andela","id":4100206,"avatar_url":"https://avatars.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":40593971,"name":"codango","full_name":"andela/codango","owner":{"login":"andela","id":4100206,"avatar_url":"https://avatars.githubusercontent.com/u/4100206?v=3","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/andela/codango","description":"Social Network for Coders","fork":false,"url":"https://api.github.com/repos/andela/codango","forks_url":"https://api.github.com/repos/andela/codango/forks","keys_url":"https://api.github.com/repos/andela/codango/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/codango/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/codango/teams","hooks_url":"https://api.github.com/repos/andela/codango/hooks","issue_events_url":"https://api.github.com/repos/andela/codango/issues/events{/number}","events_url":"https://api.github.com/repos/andela/codango/events","assignees_url":"https://api.github.com/repos/andela/codango/assignees{/user}","branches_url":"https://api.github.com/repos/andela/codango/branches{/branch}","tags_url":"https://api.github.com/repos/andela/codango/tags","blobs_url":"https://api.github.com/repos/andela/codango/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/codango/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/codango/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/codango/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/codango/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/codango/languages","stargazers_url":"https://api.github.com/repos/andela/codango/stargazers","contributors_url":"https://api.github.com/repos/andela/codango/contributors","subscribers_url":"https://api.github.com/repos/andela/codango/subscribers","subscription_url":"https://api.github.com/repos/andela/codango/subscription","commits_url":"https://api.github.com/repos/andela/codango/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/codango/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/codango/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/codango/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/codango/contents/{+path}","compare_url":"https://api.github.com/repos/andela/codango/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/codango/merges","archive_url":"https://api.github.com/repos/andela/codango/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/codango/downloads","issues_url":"https://api.github.com/repos/andela/codango/issues{/number}","pulls_url":"https://api.github.com/repos/andela/codango/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/codango/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/codango/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/codango/labels{/name}","releases_url":"https://api.github.com/repos/andela/codango/releases{/id}","deployments_url":"https://api.github.com/repos/andela/codango/deployments","created_at":"2015-08-12T10:04:41Z","updated_at":"2016-10-24T12:39:56Z","pushed_at":"2016-11-14T09:41:07Z","git_url":"git://github.com/andela/codango.git","ssh_url":"git@github.com:andela/codango.git","clone_url":"https://github.com/andela/codango.git","svn_url":"https://github.com/andela/codango","homepage":"","size":38790,"stargazers_count":8,"watchers_count":8,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":2,"forks":6,"open_issues":2,"watchers":8,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/andela/codango/pulls/169"},"html":{"href":"https://github.com/andela/codango/pull/169"},"issue":{"href":"https://api.github.com/repos/andela/codango/issues/169"},"comments":{"href":"https://api.github.com/repos/andela/codango/issues/169/comments"},"review_comments":{"href":"https://api.github.com/repos/andela/codango/pulls/169/comments"},"review_comment":{"href":"https://api.github.com/repos/andela/codango/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andela/codango/pulls/169/commits"},"statuses":{"href":"https://api.github.com/repos/andela/codango/statuses/3a848b661daaa0a49395190b9c4fcdcfe93e89f3"}}}}
{"actor":{"display_login":"andela-cobiora"}}