{"action":"created","comment":{"url":"https://api.github.com/repos/brain-tec/Training/pulls/comments/189610519","pull_request_review_id":121822984,"id":189610519,"diff_hunk":"@@ -0,0 +1,73 @@\n+from odoo.tests import common\n+\n+class TestMy_test(common.TransactionCase):\n+    def setUp(self):\n+        super(TestMy_test, self).setUp()\n+\n+    def tearDown(self):\n+        super(TestMy_test, self).tearDown()\n+\n+    def test_1_seats_updated(self):\n+        # Get initial percentage of occupied seats\n+        sessions_table = self.env['session'].search([])  #A 'search' is necessary if we want to get the records\n+                                                         # (empty if we want ALL of them)\n+        initial_seats = sessions_table[0].taken_seats_percent\n+        print('Initial percentage of occupied seats: %f' %(initial_seats))\n+\n+        # Add a new attendee (partner - Demo User)\n+        partner_table = self.env['res.partner'].search([('name', 'ilike', 'Demo User')])\n+        sessions_table[0].attendees |= partner_table[0]\n+\n+        # Get new percentage of occupied seats\n+        current_seats = sessions_table[0].taken_seats_percent\n+        print('Current percentage of occupied seats: %f' % (current_seats))\n+\n+        self.assertNotEqual(initial_seats, current_seats,\n+                            'Percentage of taken seats does not change after adding a new attendee.')\n+\n+\n+    def test_2_end_date_change(self):\n+        #Get initial duration\n+        sessions_table = self.env['session'].search([])\n+        initial_duration = sessions_table[0].duration\n+        print('Initial duration in days: %f' % (initial_duration))\n+\n+        #Change end date\n+        sessions_table[0].write({'end_date': '2018-07-01 00:00:00'})\n+        current_duration = sessions_table[0].duration\n+        print('Current duration in days: %f' % (current_duration))\n+\n+        self.assertNotEqual(initial_duration, current_duration, 'Duration does not change after modifying the end date')\n+\n+\n+    def test_3_wizard_addAttendees(self):\n+        # Get initial attendees for two sessions\n+        sessions = self.env['session'].search([])\n+        session_1 = sessions[0]","path":"openacademy/tests/test_my_test.py","position":46,"original_position":46,"commit_id":"71a905cbcfb268f81e182192c303d2867d8892cf","original_commit_id":"71a905cbcfb268f81e182192c303d2867d8892cf","user":{"login":"BT-jortells","id":39049743,"avatar_url":"https://avatars2.githubusercontent.com/u/39049743?v=4","gravatar_id":"","url":"https://api.github.com/users/BT-jortells","html_url":"https://github.com/BT-jortells","followers_url":"https://api.github.com/users/BT-jortells/followers","following_url":"https://api.github.com/users/BT-jortells/following{/other_user}","gists_url":"https://api.github.com/users/BT-jortells/gists{/gist_id}","starred_url":"https://api.github.com/users/BT-jortells/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BT-jortells/subscriptions","organizations_url":"https://api.github.com/users/BT-jortells/orgs","repos_url":"https://api.github.com/users/BT-jortells/repos","events_url":"https://api.github.com/users/BT-jortells/events{/privacy}","received_events_url":"https://api.github.com/users/BT-jortells/received_events","type":"User","site_admin":false},"body":"Now fixed in rewriting of tests","created_at":"2018-05-21T14:43:27Z","updated_at":"2018-05-21T14:43:27Z","html_url":"https://github.com/brain-tec/Training/pull/22#discussion_r189610519","pull_request_url":"https://api.github.com/repos/brain-tec/Training/pulls/22","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/brain-tec/Training/pulls/comments/189610519"},"html":{"href":"https://github.com/brain-tec/Training/pull/22#discussion_r189610519"},"pull_request":{"href":"https://api.github.com/repos/brain-tec/Training/pulls/22"}},"in_reply_to_id":188699753},"pull_request":{"url":"https://api.github.com/repos/brain-tec/Training/pulls/22","id":186694824,"html_url":"https://github.com/brain-tec/Training/pull/22","diff_url":"https://github.com/brain-tec/Training/pull/22.diff","patch_url":"https://github.com/brain-tec/Training/pull/22.patch","issue_url":"https://api.github.com/repos/brain-tec/Training/issues/22","number":22,"state":"open","locked":false,"title":"All done, including relationships and computed fields","user":{"login":"BT-jortells","id":39049743,"avatar_url":"https://avatars2.githubusercontent.com/u/39049743?v=4","gravatar_id":"","url":"https://api.github.com/users/BT-jortells","html_url":"https://github.com/BT-jortells","followers_url":"https://api.github.com/users/BT-jortells/followers","following_url":"https://api.github.com/users/BT-jortells/following{/other_user}","gists_url":"https://api.github.com/users/BT-jortells/gists{/gist_id}","starred_url":"https://api.github.com/users/BT-jortells/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BT-jortells/subscriptions","organizations_url":"https://api.github.com/users/BT-jortells/orgs","repos_url":"https://api.github.com/users/BT-jortells/repos","events_url":"https://api.github.com/users/BT-jortells/events{/privacy}","received_events_url":"https://api.github.com/users/BT-jortells/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-05-08T16:53:47Z","updated_at":"2018-05-21T14:43:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0911d3a9e872a0866ef03d88d8467a306cdedc01","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/brain-tec/Training/pulls/22/commits","review_comments_url":"https://api.github.com/repos/brain-tec/Training/pulls/22/comments","review_comment_url":"https://api.github.com/repos/brain-tec/Training/pulls/comments{/number}","comments_url":"https://api.github.com/repos/brain-tec/Training/issues/22/comments","statuses_url":"https://api.github.com/repos/brain-tec/Training/statuses/71a905cbcfb268f81e182192c303d2867d8892cf","head":{"label":"BT-jortells:11.0.orja1","ref":"11.0.orja1","sha":"71a905cbcfb268f81e182192c303d2867d8892cf","user":{"login":"BT-jortells","id":39049743,"avatar_url":"https://avatars2.githubusercontent.com/u/39049743?v=4","gravatar_id":"","url":"https://api.github.com/users/BT-jortells","html_url":"https://github.com/BT-jortells","followers_url":"https://api.github.com/users/BT-jortells/followers","following_url":"https://api.github.com/users/BT-jortells/following{/other_user}","gists_url":"https://api.github.com/users/BT-jortells/gists{/gist_id}","starred_url":"https://api.github.com/users/BT-jortells/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BT-jortells/subscriptions","organizations_url":"https://api.github.com/users/BT-jortells/orgs","repos_url":"https://api.github.com/users/BT-jortells/repos","events_url":"https://api.github.com/users/BT-jortells/events{/privacy}","received_events_url":"https://api.github.com/users/BT-jortells/received_events","type":"User","site_admin":false},"repo":{"id":132611716,"name":"Training","full_name":"BT-jortells/Training","owner":{"login":"BT-jortells","id":39049743,"avatar_url":"https://avatars2.githubusercontent.com/u/39049743?v=4","gravatar_id":"","url":"https://api.github.com/users/BT-jortells","html_url":"https://github.com/BT-jortells","followers_url":"https://api.github.com/users/BT-jortells/followers","following_url":"https://api.github.com/users/BT-jortells/following{/other_user}","gists_url":"https://api.github.com/users/BT-jortells/gists{/gist_id}","starred_url":"https://api.github.com/users/BT-jortells/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BT-jortells/subscriptions","organizations_url":"https://api.github.com/users/BT-jortells/orgs","repos_url":"https://api.github.com/users/BT-jortells/repos","events_url":"https://api.github.com/users/BT-jortells/events{/privacy}","received_events_url":"https://api.github.com/users/BT-jortells/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/BT-jortells/Training","description":null,"fork":true,"url":"https://api.github.com/repos/BT-jortells/Training","forks_url":"https://api.github.com/repos/BT-jortells/Training/forks","keys_url":"https://api.github.com/repos/BT-jortells/Training/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BT-jortells/Training/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BT-jortells/Training/teams","hooks_url":"https://api.github.com/repos/BT-jortells/Training/hooks","issue_events_url":"https://api.github.com/repos/BT-jortells/Training/issues/events{/number}","events_url":"https://api.github.com/repos/BT-jortells/Training/events","assignees_url":"https://api.github.com/repos/BT-jortells/Training/assignees{/user}","branches_url":"https://api.github.com/repos/BT-jortells/Training/branches{/branch}","tags_url":"https://api.github.com/repos/BT-jortells/Training/tags","blobs_url":"https://api.github.com/repos/BT-jortells/Training/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BT-jortells/Training/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BT-jortells/Training/git/refs{/sha}","trees_url":"https://api.github.com/repos/BT-jortells/Training/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BT-jortells/Training/statuses/{sha}","languages_url":"https://api.github.com/repos/BT-jortells/Training/languages","stargazers_url":"https://api.github.com/repos/BT-jortells/Training/stargazers","contributors_url":"https://api.github.com/repos/BT-jortells/Training/contributors","subscribers_url":"https://api.github.com/repos/BT-jortells/Training/subscribers","subscription_url":"https://api.github.com/repos/BT-jortells/Training/subscription","commits_url":"https://api.github.com/repos/BT-jortells/Training/commits{/sha}","git_commits_url":"https://api.github.com/repos/BT-jortells/Training/git/commits{/sha}","comments_url":"https://api.github.com/repos/BT-jortells/Training/comments{/number}","issue_comment_url":"https://api.github.com/repos/BT-jortells/Training/issues/comments{/number}","contents_url":"https://api.github.com/repos/BT-jortells/Training/contents/{+path}","compare_url":"https://api.github.com/repos/BT-jortells/Training/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BT-jortells/Training/merges","archive_url":"https://api.github.com/repos/BT-jortells/Training/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BT-jortells/Training/downloads","issues_url":"https://api.github.com/repos/BT-jortells/Training/issues{/number}","pulls_url":"https://api.github.com/repos/BT-jortells/Training/pulls{/number}","milestones_url":"https://api.github.com/repos/BT-jortells/Training/milestones{/number}","notifications_url":"https://api.github.com/repos/BT-jortells/Training/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BT-jortells/Training/labels{/name}","releases_url":"https://api.github.com/repos/BT-jortells/Training/releases{/id}","deployments_url":"https://api.github.com/repos/BT-jortells/Training/deployments","created_at":"2018-05-08T13:17:23Z","updated_at":"2018-05-08T13:17:25Z","pushed_at":"2018-05-17T14:27:37Z","git_url":"git://github.com/BT-jortells/Training.git","ssh_url":"git@github.com:BT-jortells/Training.git","clone_url":"https://github.com/BT-jortells/Training.git","svn_url":"https://github.com/BT-jortells/Training","homepage":null,"size":203,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"brain-tec:11.0.orja1","ref":"11.0.orja1","sha":"2071b1b4a7575435613c90c2acecbdc10175b97e","user":{"login":"brain-tec","id":9976435,"avatar_url":"https://avatars3.githubusercontent.com/u/9976435?v=4","gravatar_id":"","url":"https://api.github.com/users/brain-tec","html_url":"https://github.com/brain-tec","followers_url":"https://api.github.com/users/brain-tec/followers","following_url":"https://api.github.com/users/brain-tec/following{/other_user}","gists_url":"https://api.github.com/users/brain-tec/gists{/gist_id}","starred_url":"https://api.github.com/users/brain-tec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brain-tec/subscriptions","organizations_url":"https://api.github.com/users/brain-tec/orgs","repos_url":"https://api.github.com/users/brain-tec/repos","events_url":"https://api.github.com/users/brain-tec/events{/privacy}","received_events_url":"https://api.github.com/users/brain-tec/received_events","type":"Organization","site_admin":false},"repo":{"id":33656417,"name":"Training","full_name":"brain-tec/Training","owner":{"login":"brain-tec","id":9976435,"avatar_url":"https://avatars3.githubusercontent.com/u/9976435?v=4","gravatar_id":"","url":"https://api.github.com/users/brain-tec","html_url":"https://github.com/brain-tec","followers_url":"https://api.github.com/users/brain-tec/followers","following_url":"https://api.github.com/users/brain-tec/following{/other_user}","gists_url":"https://api.github.com/users/brain-tec/gists{/gist_id}","starred_url":"https://api.github.com/users/brain-tec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brain-tec/subscriptions","organizations_url":"https://api.github.com/users/brain-tec/orgs","repos_url":"https://api.github.com/users/brain-tec/repos","events_url":"https://api.github.com/users/brain-tec/events{/privacy}","received_events_url":"https://api.github.com/users/brain-tec/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/brain-tec/Training","description":null,"fork":false,"url":"https://api.github.com/repos/brain-tec/Training","forks_url":"https://api.github.com/repos/brain-tec/Training/forks","keys_url":"https://api.github.com/repos/brain-tec/Training/keys{/key_id}","collaborators_url":"https://api.github.com/repos/brain-tec/Training/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/brain-tec/Training/teams","hooks_url":"https://api.github.com/repos/brain-tec/Training/hooks","issue_events_url":"https://api.github.com/repos/brain-tec/Training/issues/events{/number}","events_url":"https://api.github.com/repos/brain-tec/Training/events","assignees_url":"https://api.github.com/repos/brain-tec/Training/assignees{/user}","branches_url":"https://api.github.com/repos/brain-tec/Training/branches{/branch}","tags_url":"https://api.github.com/repos/brain-tec/Training/tags","blobs_url":"https://api.github.com/repos/brain-tec/Training/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/brain-tec/Training/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/brain-tec/Training/git/refs{/sha}","trees_url":"https://api.github.com/repos/brain-tec/Training/git/trees{/sha}","statuses_url":"https://api.github.com/repos/brain-tec/Training/statuses/{sha}","languages_url":"https://api.github.com/repos/brain-tec/Training/languages","stargazers_url":"https://api.github.com/repos/brain-tec/Training/stargazers","contributors_url":"https://api.github.com/repos/brain-tec/Training/contributors","subscribers_url":"https://api.github.com/repos/brain-tec/Training/subscribers","subscription_url":"https://api.github.com/repos/brain-tec/Training/subscription","commits_url":"https://api.github.com/repos/brain-tec/Training/commits{/sha}","git_commits_url":"https://api.github.com/repos/brain-tec/Training/git/commits{/sha}","comments_url":"https://api.github.com/repos/brain-tec/Training/comments{/number}","issue_comment_url":"https://api.github.com/repos/brain-tec/Training/issues/comments{/number}","contents_url":"https://api.github.com/repos/brain-tec/Training/contents/{+path}","compare_url":"https://api.github.com/repos/brain-tec/Training/compare/{base}...{head}","merges_url":"https://api.github.com/repos/brain-tec/Training/merges","archive_url":"https://api.github.com/repos/brain-tec/Training/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/brain-tec/Training/downloads","issues_url":"https://api.github.com/repos/brain-tec/Training/issues{/number}","pulls_url":"https://api.github.com/repos/brain-tec/Training/pulls{/number}","milestones_url":"https://api.github.com/repos/brain-tec/Training/milestones{/number}","notifications_url":"https://api.github.com/repos/brain-tec/Training/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/brain-tec/Training/labels{/name}","releases_url":"https://api.github.com/repos/brain-tec/Training/releases{/id}","deployments_url":"https://api.github.com/repos/brain-tec/Training/deployments","created_at":"2015-04-09T08:04:49Z","updated_at":"2016-04-13T06:28:35Z","pushed_at":"2018-05-21T07:54:29Z","git_url":"git://github.com/brain-tec/Training.git","ssh_url":"git@github.com:brain-tec/Training.git","clone_url":"https://github.com/brain-tec/Training.git","svn_url":"https://github.com/brain-tec/Training","homepage":null,"size":188,"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":14,"mirror_url":null,"archived":false,"open_issues_count":6,"license":null,"forks":14,"open_issues":6,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/brain-tec/Training/pulls/22"},"html":{"href":"https://github.com/brain-tec/Training/pull/22"},"issue":{"href":"https://api.github.com/repos/brain-tec/Training/issues/22"},"comments":{"href":"https://api.github.com/repos/brain-tec/Training/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/brain-tec/Training/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/brain-tec/Training/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/brain-tec/Training/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/brain-tec/Training/statuses/71a905cbcfb268f81e182192c303d2867d8892cf"}},"author_association":"NONE"}}
{"actor":{"display_login":"BT-jortells"}}