{"action":"created","comment":{"url":"https://api.github.com/repos/allegro/ralph/pulls/comments/54403089","id":54403089,"diff_hunk":"@@ -296,6 +297,20 @@ def test_convert_to_data_center_asset(self):\n         )\n         self.assertEqual(dc_asset.hostname, hostname)\n \n+    def test_assign_many_licences(self):\n+        asset = BackOfficeAssetFactory()\n+        licences = [LicenceFactory() for i in range(2)]\n+        self.assertFalse(asset.licences.all())\n+\n+        BackOfficeAsset.assign_licence(\n+            instances=[asset], request=None, licence=licences,\n+        )\n+\n+        self.assertEqual(","path":"src/ralph/back_office/tests/test_models.py","position":21,"original_position":21,"commit_id":"c5fc65c80363813166d58c52dc98a2268aca66aa","original_commit_id":"c5fc65c80363813166d58c52dc98a2268aca66aa","user":{"login":"mkurek","id":107437,"avatar_url":"https://avatars.githubusercontent.com/u/107437?v=3","gravatar_id":"","url":"https://api.github.com/users/mkurek","html_url":"https://github.com/mkurek","followers_url":"https://api.github.com/users/mkurek/followers","following_url":"https://api.github.com/users/mkurek/following{/other_user}","gists_url":"https://api.github.com/users/mkurek/gists{/gist_id}","starred_url":"https://api.github.com/users/mkurek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkurek/subscriptions","organizations_url":"https://api.github.com/users/mkurek/orgs","repos_url":"https://api.github.com/users/mkurek/repos","events_url":"https://api.github.com/users/mkurek/events{/privacy}","received_events_url":"https://api.github.com/users/mkurek/received_events","type":"User","site_admin":false},"body":"I'd use https://docs.python.org/3.4/library/unittest.html#unittest.TestCase.assertCountEqual here","created_at":"2016-02-29T12:25:18Z","updated_at":"2016-02-29T12:25:18Z","html_url":"https://github.com/allegro/ralph/pull/2250#discussion_r54403089","pull_request_url":"https://api.github.com/repos/allegro/ralph/pulls/2250","_links":{"self":{"href":"https://api.github.com/repos/allegro/ralph/pulls/comments/54403089"},"html":{"href":"https://github.com/allegro/ralph/pull/2250#discussion_r54403089"},"pull_request":{"href":"https://api.github.com/repos/allegro/ralph/pulls/2250"}}},"pull_request":{"url":"https://api.github.com/repos/allegro/ralph/pulls/2250","id":60843761,"html_url":"https://github.com/allegro/ralph/pull/2250","diff_url":"https://github.com/allegro/ralph/pull/2250.diff","patch_url":"https://github.com/allegro/ralph/pull/2250.patch","issue_url":"https://api.github.com/repos/allegro/ralph/issues/2250","number":2250,"state":"open","locked":false,"title":"[WIP] Added m2m for licence in `Assign licence` transition.","user":{"login":"xliiv","id":298994,"avatar_url":"https://avatars.githubusercontent.com/u/298994?v=3","gravatar_id":"","url":"https://api.github.com/users/xliiv","html_url":"https://github.com/xliiv","followers_url":"https://api.github.com/users/xliiv/followers","following_url":"https://api.github.com/users/xliiv/following{/other_user}","gists_url":"https://api.github.com/users/xliiv/gists{/gist_id}","starred_url":"https://api.github.com/users/xliiv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xliiv/subscriptions","organizations_url":"https://api.github.com/users/xliiv/orgs","repos_url":"https://api.github.com/users/xliiv/repos","events_url":"https://api.github.com/users/xliiv/events{/privacy}","received_events_url":"https://api.github.com/users/xliiv/received_events","type":"User","site_admin":false},"body":"Before:\r\nUser could pick only one licence in `Assign licence` tranision.\r\nNow:\r\nUser can pick many licences in `Assign licence` tranision.","created_at":"2016-02-26T13:46:45Z","updated_at":"2016-02-29T12:25:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2c5bcb7317b61288ffbf9bb4cf856e8758949b8f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/allegro/ralph/pulls/2250/commits","review_comments_url":"https://api.github.com/repos/allegro/ralph/pulls/2250/comments","review_comment_url":"https://api.github.com/repos/allegro/ralph/pulls/comments{/number}","comments_url":"https://api.github.com/repos/allegro/ralph/issues/2250/comments","statuses_url":"https://api.github.com/repos/allegro/ralph/statuses/c5fc65c80363813166d58c52dc98a2268aca66aa","head":{"label":"xliiv:m2m-transition","ref":"m2m-transition","sha":"c5fc65c80363813166d58c52dc98a2268aca66aa","user":{"login":"xliiv","id":298994,"avatar_url":"https://avatars.githubusercontent.com/u/298994?v=3","gravatar_id":"","url":"https://api.github.com/users/xliiv","html_url":"https://github.com/xliiv","followers_url":"https://api.github.com/users/xliiv/followers","following_url":"https://api.github.com/users/xliiv/following{/other_user}","gists_url":"https://api.github.com/users/xliiv/gists{/gist_id}","starred_url":"https://api.github.com/users/xliiv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xliiv/subscriptions","organizations_url":"https://api.github.com/users/xliiv/orgs","repos_url":"https://api.github.com/users/xliiv/repos","events_url":"https://api.github.com/users/xliiv/events{/privacy}","received_events_url":"https://api.github.com/users/xliiv/received_events","type":"User","site_admin":false},"repo":{"id":16946165,"name":"ralph","full_name":"xliiv/ralph","owner":{"login":"xliiv","id":298994,"avatar_url":"https://avatars.githubusercontent.com/u/298994?v=3","gravatar_id":"","url":"https://api.github.com/users/xliiv","html_url":"https://github.com/xliiv","followers_url":"https://api.github.com/users/xliiv/followers","following_url":"https://api.github.com/users/xliiv/following{/other_user}","gists_url":"https://api.github.com/users/xliiv/gists{/gist_id}","starred_url":"https://api.github.com/users/xliiv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xliiv/subscriptions","organizations_url":"https://api.github.com/users/xliiv/orgs","repos_url":"https://api.github.com/users/xliiv/repos","events_url":"https://api.github.com/users/xliiv/events{/privacy}","received_events_url":"https://api.github.com/users/xliiv/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/xliiv/ralph","description":"Ralph is an asset management system for your data center.","fork":true,"url":"https://api.github.com/repos/xliiv/ralph","forks_url":"https://api.github.com/repos/xliiv/ralph/forks","keys_url":"https://api.github.com/repos/xliiv/ralph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xliiv/ralph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xliiv/ralph/teams","hooks_url":"https://api.github.com/repos/xliiv/ralph/hooks","issue_events_url":"https://api.github.com/repos/xliiv/ralph/issues/events{/number}","events_url":"https://api.github.com/repos/xliiv/ralph/events","assignees_url":"https://api.github.com/repos/xliiv/ralph/assignees{/user}","branches_url":"https://api.github.com/repos/xliiv/ralph/branches{/branch}","tags_url":"https://api.github.com/repos/xliiv/ralph/tags","blobs_url":"https://api.github.com/repos/xliiv/ralph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xliiv/ralph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xliiv/ralph/git/refs{/sha}","trees_url":"https://api.github.com/repos/xliiv/ralph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xliiv/ralph/statuses/{sha}","languages_url":"https://api.github.com/repos/xliiv/ralph/languages","stargazers_url":"https://api.github.com/repos/xliiv/ralph/stargazers","contributors_url":"https://api.github.com/repos/xliiv/ralph/contributors","subscribers_url":"https://api.github.com/repos/xliiv/ralph/subscribers","subscription_url":"https://api.github.com/repos/xliiv/ralph/subscription","commits_url":"https://api.github.com/repos/xliiv/ralph/commits{/sha}","git_commits_url":"https://api.github.com/repos/xliiv/ralph/git/commits{/sha}","comments_url":"https://api.github.com/repos/xliiv/ralph/comments{/number}","issue_comment_url":"https://api.github.com/repos/xliiv/ralph/issues/comments{/number}","contents_url":"https://api.github.com/repos/xliiv/ralph/contents/{+path}","compare_url":"https://api.github.com/repos/xliiv/ralph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xliiv/ralph/merges","archive_url":"https://api.github.com/repos/xliiv/ralph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xliiv/ralph/downloads","issues_url":"https://api.github.com/repos/xliiv/ralph/issues{/number}","pulls_url":"https://api.github.com/repos/xliiv/ralph/pulls{/number}","milestones_url":"https://api.github.com/repos/xliiv/ralph/milestones{/number}","notifications_url":"https://api.github.com/repos/xliiv/ralph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xliiv/ralph/labels{/name}","releases_url":"https://api.github.com/repos/xliiv/ralph/releases{/id}","deployments_url":"https://api.github.com/repos/xliiv/ralph/deployments","created_at":"2014-02-18T11:03:52Z","updated_at":"2015-01-05T10:16:49Z","pushed_at":"2016-02-29T12:23:05Z","git_url":"git://github.com/xliiv/ralph.git","ssh_url":"git@github.com:xliiv/ralph.git","clone_url":"https://github.com/xliiv/ralph.git","svn_url":"https://github.com/xliiv/ralph","homepage":"http://ralph.allegrogroup.com/","size":30349,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"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":"allegro:ng","ref":"ng","sha":"7cf0f123e9f9ef7bb206785afee232b2ec3f80d0","user":{"login":"allegro","id":562236,"avatar_url":"https://avatars.githubusercontent.com/u/562236?v=3","gravatar_id":"","url":"https://api.github.com/users/allegro","html_url":"https://github.com/allegro","followers_url":"https://api.github.com/users/allegro/followers","following_url":"https://api.github.com/users/allegro/following{/other_user}","gists_url":"https://api.github.com/users/allegro/gists{/gist_id}","starred_url":"https://api.github.com/users/allegro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allegro/subscriptions","organizations_url":"https://api.github.com/users/allegro/orgs","repos_url":"https://api.github.com/users/allegro/repos","events_url":"https://api.github.com/users/allegro/events{/privacy}","received_events_url":"https://api.github.com/users/allegro/received_events","type":"Organization","site_admin":false},"repo":{"id":4359038,"name":"ralph","full_name":"allegro/ralph","owner":{"login":"allegro","id":562236,"avatar_url":"https://avatars.githubusercontent.com/u/562236?v=3","gravatar_id":"","url":"https://api.github.com/users/allegro","html_url":"https://github.com/allegro","followers_url":"https://api.github.com/users/allegro/followers","following_url":"https://api.github.com/users/allegro/following{/other_user}","gists_url":"https://api.github.com/users/allegro/gists{/gist_id}","starred_url":"https://api.github.com/users/allegro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allegro/subscriptions","organizations_url":"https://api.github.com/users/allegro/orgs","repos_url":"https://api.github.com/users/allegro/repos","events_url":"https://api.github.com/users/allegro/events{/privacy}","received_events_url":"https://api.github.com/users/allegro/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/allegro/ralph","description":"Ralph is an asset management system for your data center.","fork":false,"url":"https://api.github.com/repos/allegro/ralph","forks_url":"https://api.github.com/repos/allegro/ralph/forks","keys_url":"https://api.github.com/repos/allegro/ralph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/allegro/ralph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/allegro/ralph/teams","hooks_url":"https://api.github.com/repos/allegro/ralph/hooks","issue_events_url":"https://api.github.com/repos/allegro/ralph/issues/events{/number}","events_url":"https://api.github.com/repos/allegro/ralph/events","assignees_url":"https://api.github.com/repos/allegro/ralph/assignees{/user}","branches_url":"https://api.github.com/repos/allegro/ralph/branches{/branch}","tags_url":"https://api.github.com/repos/allegro/ralph/tags","blobs_url":"https://api.github.com/repos/allegro/ralph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/allegro/ralph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/allegro/ralph/git/refs{/sha}","trees_url":"https://api.github.com/repos/allegro/ralph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/allegro/ralph/statuses/{sha}","languages_url":"https://api.github.com/repos/allegro/ralph/languages","stargazers_url":"https://api.github.com/repos/allegro/ralph/stargazers","contributors_url":"https://api.github.com/repos/allegro/ralph/contributors","subscribers_url":"https://api.github.com/repos/allegro/ralph/subscribers","subscription_url":"https://api.github.com/repos/allegro/ralph/subscription","commits_url":"https://api.github.com/repos/allegro/ralph/commits{/sha}","git_commits_url":"https://api.github.com/repos/allegro/ralph/git/commits{/sha}","comments_url":"https://api.github.com/repos/allegro/ralph/comments{/number}","issue_comment_url":"https://api.github.com/repos/allegro/ralph/issues/comments{/number}","contents_url":"https://api.github.com/repos/allegro/ralph/contents/{+path}","compare_url":"https://api.github.com/repos/allegro/ralph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/allegro/ralph/merges","archive_url":"https://api.github.com/repos/allegro/ralph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/allegro/ralph/downloads","issues_url":"https://api.github.com/repos/allegro/ralph/issues{/number}","pulls_url":"https://api.github.com/repos/allegro/ralph/pulls{/number}","milestones_url":"https://api.github.com/repos/allegro/ralph/milestones{/number}","notifications_url":"https://api.github.com/repos/allegro/ralph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/allegro/ralph/labels{/name}","releases_url":"https://api.github.com/repos/allegro/ralph/releases{/id}","deployments_url":"https://api.github.com/repos/allegro/ralph/deployments","created_at":"2012-05-17T14:04:57Z","updated_at":"2016-02-29T05:02:54Z","pushed_at":"2016-02-29T12:23:05Z","git_url":"git://github.com/allegro/ralph.git","ssh_url":"git@github.com:allegro/ralph.git","clone_url":"https://github.com/allegro/ralph.git","svn_url":"https://github.com/allegro/ralph","homepage":"http://allegro.tech/ralph/","size":32753,"stargazers_count":375,"watchers_count":375,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":94,"mirror_url":null,"open_issues_count":76,"forks":94,"open_issues":76,"watchers":375,"default_branch":"ng"}},"_links":{"self":{"href":"https://api.github.com/repos/allegro/ralph/pulls/2250"},"html":{"href":"https://github.com/allegro/ralph/pull/2250"},"issue":{"href":"https://api.github.com/repos/allegro/ralph/issues/2250"},"comments":{"href":"https://api.github.com/repos/allegro/ralph/issues/2250/comments"},"review_comments":{"href":"https://api.github.com/repos/allegro/ralph/pulls/2250/comments"},"review_comment":{"href":"https://api.github.com/repos/allegro/ralph/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/allegro/ralph/pulls/2250/commits"},"statuses":{"href":"https://api.github.com/repos/allegro/ralph/statuses/c5fc65c80363813166d58c52dc98a2268aca66aa"}}}}