{"action":"created","comment":{"url":"https://api.github.com/repos/oppia/oppia/pulls/comments/59333085","id":59333085,"diff_hunk":"@@ -0,0 +1,139 @@\n+# coding: utf-8\n+#\n+# Copyright 2014 The Oppia Authors. All Rights Reserved.\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+#      http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, softwar\n+# distributed under the License is distributed on an \"AS-IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+\n+\"\"\"Tests for feedback domain objects.\"\"\"\n+\n+import datetime\n+\n+from core.domain import feedback_domain\n+from core.domain import user_services\n+from core.tests import test_utils\n+import utils\n+\n+class FeedbackThreadDomainUnitTests(test_utils.GenericTestBase):\n+    EXP_ID = 'exp0'\n+    THREAD_ID = 'thread0'\n+    FULL_THREAD_ID = EXP_ID + '.' + THREAD_ID\n+\n+    def setUp(self):\n+        super(FeedbackThreadDomainUnitTests, self).setUp()\n+\n+        self.viewer_id = self.get_user_id_from_email(self.VIEWER_EMAIL)\n+        user_services.get_or_create_user(self.viewer_id, self.VIEWER_EMAIL)\n+        self.signup(self.VIEWER_EMAIL, self.VIEWER_USERNAME)\n+\n+    def test_to_dict(self):\n+        fake_date = datetime.datetime(2016, 4, 10, 0, 0, 0, 0)\n+        expected_thread = {\n+            'thread_id': self.THREAD_ID,\n+            'status': u'open',\n+            'state_name': u'a_state_name',\n+            'summary': None,\n+            'original_author_username': self.VIEWER_USERNAME,\n+            'subject': u'a subject',\n+            'last_updated': utils.get_time_in_millisecs(fake_date)\n+        }\n+        thread = feedback_domain.FeedbackThread(\n+            self.FULL_THREAD_ID, self.EXP_ID, expected_thread['state_name'],\n+            self.viewer_id, expected_thread['status'],\n+            expected_thread['subject'], expected_thread['summary'],\n+            False, fake_date, fake_date)\n+        self.assertDictEqual(expected_thread, thread.to_dict())\n+\n+    def test_get_exp_id_from_full_thread_id(self):\n+        feedback_thread_cl = feedback_domain.FeedbackThread\n+        self.assertEqual(feedback_thread_cl.get_exp_id_from_full_thread_id(","path":"core/domain/feedback_domain_test.py","position":58,"original_position":58,"commit_id":"19005b26d5fa3ac0faec8a31cde233538f187a0d","original_commit_id":"19005b26d5fa3ac0faec8a31cde233538f187a0d","user":{"login":"seanlip","id":10575562,"avatar_url":"https://avatars.githubusercontent.com/u/10575562?v=3","gravatar_id":"","url":"https://api.github.com/users/seanlip","html_url":"https://github.com/seanlip","followers_url":"https://api.github.com/users/seanlip/followers","following_url":"https://api.github.com/users/seanlip/following{/other_user}","gists_url":"https://api.github.com/users/seanlip/gists{/gist_id}","starred_url":"https://api.github.com/users/seanlip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanlip/subscriptions","organizations_url":"https://api.github.com/users/seanlip/orgs","repos_url":"https://api.github.com/users/seanlip/repos","events_url":"https://api.github.com/users/seanlip/events{/privacy}","received_events_url":"https://api.github.com/users/seanlip/received_events","type":"User","site_admin":false},"body":"(It seems a bit odd to just rename the class.)","created_at":"2016-04-12T07:42:17Z","updated_at":"2016-04-12T07:42:17Z","html_url":"https://github.com/oppia/oppia/pull/1429#discussion_r59333085","pull_request_url":"https://api.github.com/repos/oppia/oppia/pulls/1429","_links":{"self":{"href":"https://api.github.com/repos/oppia/oppia/pulls/comments/59333085"},"html":{"href":"https://github.com/oppia/oppia/pull/1429#discussion_r59333085"},"pull_request":{"href":"https://api.github.com/repos/oppia/oppia/pulls/1429"}}},"pull_request":{"url":"https://api.github.com/repos/oppia/oppia/pulls/1429","id":57063648,"html_url":"https://github.com/oppia/oppia/pull/1429","diff_url":"https://github.com/oppia/oppia/pull/1429.diff","patch_url":"https://github.com/oppia/oppia/pull/1429.patch","issue_url":"https://api.github.com/repos/oppia/oppia/issues/1429","number":1429,"state":"open","locked":false,"title":"Add domain layer to feedback_services.py","user":{"login":"maitbayev","id":5602283,"avatar_url":"https://avatars.githubusercontent.com/u/5602283?v=3","gravatar_id":"","url":"https://api.github.com/users/maitbayev","html_url":"https://github.com/maitbayev","followers_url":"https://api.github.com/users/maitbayev/followers","following_url":"https://api.github.com/users/maitbayev/following{/other_user}","gists_url":"https://api.github.com/users/maitbayev/gists{/gist_id}","starred_url":"https://api.github.com/users/maitbayev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maitbayev/subscriptions","organizations_url":"https://api.github.com/users/maitbayev/orgs","repos_url":"https://api.github.com/users/maitbayev/repos","events_url":"https://api.github.com/users/maitbayev/events{/privacy}","received_events_url":"https://api.github.com/users/maitbayev/received_events","type":"User","site_admin":false},"body":"Fixes #1369","created_at":"2016-01-25T12:16:02Z","updated_at":"2016-04-12T07:42:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fb9cb967eb4ca5edf2fa713a69c2f4571edb5a8f","assignee":{"login":"seanlip","id":10575562,"avatar_url":"https://avatars.githubusercontent.com/u/10575562?v=3","gravatar_id":"","url":"https://api.github.com/users/seanlip","html_url":"https://github.com/seanlip","followers_url":"https://api.github.com/users/seanlip/followers","following_url":"https://api.github.com/users/seanlip/following{/other_user}","gists_url":"https://api.github.com/users/seanlip/gists{/gist_id}","starred_url":"https://api.github.com/users/seanlip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seanlip/subscriptions","organizations_url":"https://api.github.com/users/seanlip/orgs","repos_url":"https://api.github.com/users/seanlip/repos","events_url":"https://api.github.com/users/seanlip/events{/privacy}","received_events_url":"https://api.github.com/users/seanlip/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/oppia/oppia/pulls/1429/commits","review_comments_url":"https://api.github.com/repos/oppia/oppia/pulls/1429/comments","review_comment_url":"https://api.github.com/repos/oppia/oppia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/oppia/oppia/issues/1429/comments","statuses_url":"https://api.github.com/repos/oppia/oppia/statuses/19005b26d5fa3ac0faec8a31cde233538f187a0d","head":{"label":"maitbayev:feedback-refactor","ref":"feedback-refactor","sha":"19005b26d5fa3ac0faec8a31cde233538f187a0d","user":{"login":"maitbayev","id":5602283,"avatar_url":"https://avatars.githubusercontent.com/u/5602283?v=3","gravatar_id":"","url":"https://api.github.com/users/maitbayev","html_url":"https://github.com/maitbayev","followers_url":"https://api.github.com/users/maitbayev/followers","following_url":"https://api.github.com/users/maitbayev/following{/other_user}","gists_url":"https://api.github.com/users/maitbayev/gists{/gist_id}","starred_url":"https://api.github.com/users/maitbayev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maitbayev/subscriptions","organizations_url":"https://api.github.com/users/maitbayev/orgs","repos_url":"https://api.github.com/users/maitbayev/repos","events_url":"https://api.github.com/users/maitbayev/events{/privacy}","received_events_url":"https://api.github.com/users/maitbayev/received_events","type":"User","site_admin":false},"repo":{"id":47291248,"name":"oppia","full_name":"maitbayev/oppia","owner":{"login":"maitbayev","id":5602283,"avatar_url":"https://avatars.githubusercontent.com/u/5602283?v=3","gravatar_id":"","url":"https://api.github.com/users/maitbayev","html_url":"https://github.com/maitbayev","followers_url":"https://api.github.com/users/maitbayev/followers","following_url":"https://api.github.com/users/maitbayev/following{/other_user}","gists_url":"https://api.github.com/users/maitbayev/gists{/gist_id}","starred_url":"https://api.github.com/users/maitbayev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maitbayev/subscriptions","organizations_url":"https://api.github.com/users/maitbayev/orgs","repos_url":"https://api.github.com/users/maitbayev/repos","events_url":"https://api.github.com/users/maitbayev/events{/privacy}","received_events_url":"https://api.github.com/users/maitbayev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/maitbayev/oppia","description":"Tool for collaboratively building interactive tutors.","fork":true,"url":"https://api.github.com/repos/maitbayev/oppia","forks_url":"https://api.github.com/repos/maitbayev/oppia/forks","keys_url":"https://api.github.com/repos/maitbayev/oppia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maitbayev/oppia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maitbayev/oppia/teams","hooks_url":"https://api.github.com/repos/maitbayev/oppia/hooks","issue_events_url":"https://api.github.com/repos/maitbayev/oppia/issues/events{/number}","events_url":"https://api.github.com/repos/maitbayev/oppia/events","assignees_url":"https://api.github.com/repos/maitbayev/oppia/assignees{/user}","branches_url":"https://api.github.com/repos/maitbayev/oppia/branches{/branch}","tags_url":"https://api.github.com/repos/maitbayev/oppia/tags","blobs_url":"https://api.github.com/repos/maitbayev/oppia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maitbayev/oppia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maitbayev/oppia/git/refs{/sha}","trees_url":"https://api.github.com/repos/maitbayev/oppia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maitbayev/oppia/statuses/{sha}","languages_url":"https://api.github.com/repos/maitbayev/oppia/languages","stargazers_url":"https://api.github.com/repos/maitbayev/oppia/stargazers","contributors_url":"https://api.github.com/repos/maitbayev/oppia/contributors","subscribers_url":"https://api.github.com/repos/maitbayev/oppia/subscribers","subscription_url":"https://api.github.com/repos/maitbayev/oppia/subscription","commits_url":"https://api.github.com/repos/maitbayev/oppia/commits{/sha}","git_commits_url":"https://api.github.com/repos/maitbayev/oppia/git/commits{/sha}","comments_url":"https://api.github.com/repos/maitbayev/oppia/comments{/number}","issue_comment_url":"https://api.github.com/repos/maitbayev/oppia/issues/comments{/number}","contents_url":"https://api.github.com/repos/maitbayev/oppia/contents/{+path}","compare_url":"https://api.github.com/repos/maitbayev/oppia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maitbayev/oppia/merges","archive_url":"https://api.github.com/repos/maitbayev/oppia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maitbayev/oppia/downloads","issues_url":"https://api.github.com/repos/maitbayev/oppia/issues{/number}","pulls_url":"https://api.github.com/repos/maitbayev/oppia/pulls{/number}","milestones_url":"https://api.github.com/repos/maitbayev/oppia/milestones{/number}","notifications_url":"https://api.github.com/repos/maitbayev/oppia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maitbayev/oppia/labels{/name}","releases_url":"https://api.github.com/repos/maitbayev/oppia/releases{/id}","deployments_url":"https://api.github.com/repos/maitbayev/oppia/deployments","created_at":"2015-12-02T22:01:37Z","updated_at":"2015-12-02T22:01:41Z","pushed_at":"2016-04-11T17:20:42Z","git_url":"git://github.com/maitbayev/oppia.git","ssh_url":"git@github.com:maitbayev/oppia.git","clone_url":"https://github.com/maitbayev/oppia.git","svn_url":"https://github.com/maitbayev/oppia","homepage":"https://www.oppia.org","size":42514,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":false,"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":"develop"}},"base":{"label":"oppia:develop","ref":"develop","sha":"15d3568c6db37a79f96e1553cc42f7e164c2a95e","user":{"login":"oppia","id":11620230,"avatar_url":"https://avatars.githubusercontent.com/u/11620230?v=3","gravatar_id":"","url":"https://api.github.com/users/oppia","html_url":"https://github.com/oppia","followers_url":"https://api.github.com/users/oppia/followers","following_url":"https://api.github.com/users/oppia/following{/other_user}","gists_url":"https://api.github.com/users/oppia/gists{/gist_id}","starred_url":"https://api.github.com/users/oppia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oppia/subscriptions","organizations_url":"https://api.github.com/users/oppia/orgs","repos_url":"https://api.github.com/users/oppia/repos","events_url":"https://api.github.com/users/oppia/events{/privacy}","received_events_url":"https://api.github.com/users/oppia/received_events","type":"Organization","site_admin":false},"repo":{"id":40687563,"name":"oppia","full_name":"oppia/oppia","owner":{"login":"oppia","id":11620230,"avatar_url":"https://avatars.githubusercontent.com/u/11620230?v=3","gravatar_id":"","url":"https://api.github.com/users/oppia","html_url":"https://github.com/oppia","followers_url":"https://api.github.com/users/oppia/followers","following_url":"https://api.github.com/users/oppia/following{/other_user}","gists_url":"https://api.github.com/users/oppia/gists{/gist_id}","starred_url":"https://api.github.com/users/oppia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oppia/subscriptions","organizations_url":"https://api.github.com/users/oppia/orgs","repos_url":"https://api.github.com/users/oppia/repos","events_url":"https://api.github.com/users/oppia/events{/privacy}","received_events_url":"https://api.github.com/users/oppia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/oppia/oppia","description":"Tool for collaboratively building intelligent tutors.","fork":false,"url":"https://api.github.com/repos/oppia/oppia","forks_url":"https://api.github.com/repos/oppia/oppia/forks","keys_url":"https://api.github.com/repos/oppia/oppia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oppia/oppia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oppia/oppia/teams","hooks_url":"https://api.github.com/repos/oppia/oppia/hooks","issue_events_url":"https://api.github.com/repos/oppia/oppia/issues/events{/number}","events_url":"https://api.github.com/repos/oppia/oppia/events","assignees_url":"https://api.github.com/repos/oppia/oppia/assignees{/user}","branches_url":"https://api.github.com/repos/oppia/oppia/branches{/branch}","tags_url":"https://api.github.com/repos/oppia/oppia/tags","blobs_url":"https://api.github.com/repos/oppia/oppia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oppia/oppia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oppia/oppia/git/refs{/sha}","trees_url":"https://api.github.com/repos/oppia/oppia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oppia/oppia/statuses/{sha}","languages_url":"https://api.github.com/repos/oppia/oppia/languages","stargazers_url":"https://api.github.com/repos/oppia/oppia/stargazers","contributors_url":"https://api.github.com/repos/oppia/oppia/contributors","subscribers_url":"https://api.github.com/repos/oppia/oppia/subscribers","subscription_url":"https://api.github.com/repos/oppia/oppia/subscription","commits_url":"https://api.github.com/repos/oppia/oppia/commits{/sha}","git_commits_url":"https://api.github.com/repos/oppia/oppia/git/commits{/sha}","comments_url":"https://api.github.com/repos/oppia/oppia/comments{/number}","issue_comment_url":"https://api.github.com/repos/oppia/oppia/issues/comments{/number}","contents_url":"https://api.github.com/repos/oppia/oppia/contents/{+path}","compare_url":"https://api.github.com/repos/oppia/oppia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oppia/oppia/merges","archive_url":"https://api.github.com/repos/oppia/oppia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oppia/oppia/downloads","issues_url":"https://api.github.com/repos/oppia/oppia/issues{/number}","pulls_url":"https://api.github.com/repos/oppia/oppia/pulls{/number}","milestones_url":"https://api.github.com/repos/oppia/oppia/milestones{/number}","notifications_url":"https://api.github.com/repos/oppia/oppia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oppia/oppia/labels{/name}","releases_url":"https://api.github.com/repos/oppia/oppia/releases{/id}","deployments_url":"https://api.github.com/repos/oppia/oppia/deployments","created_at":"2015-08-14T00:16:14Z","updated_at":"2016-04-10T04:54:38Z","pushed_at":"2016-04-12T06:18:00Z","git_url":"git://github.com/oppia/oppia.git","ssh_url":"git@github.com:oppia/oppia.git","clone_url":"https://github.com/oppia/oppia.git","svn_url":"https://github.com/oppia/oppia","homepage":"https://www.oppia.org","size":74974,"stargazers_count":115,"watchers_count":115,"language":"Python","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":183,"mirror_url":null,"open_issues_count":288,"forks":183,"open_issues":288,"watchers":115,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/oppia/oppia/pulls/1429"},"html":{"href":"https://github.com/oppia/oppia/pull/1429"},"issue":{"href":"https://api.github.com/repos/oppia/oppia/issues/1429"},"comments":{"href":"https://api.github.com/repos/oppia/oppia/issues/1429/comments"},"review_comments":{"href":"https://api.github.com/repos/oppia/oppia/pulls/1429/comments"},"review_comment":{"href":"https://api.github.com/repos/oppia/oppia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/oppia/oppia/pulls/1429/commits"},"statuses":{"href":"https://api.github.com/repos/oppia/oppia/statuses/19005b26d5fa3ac0faec8a31cde233538f187a0d"}}}}