{"action":"created","comment":{"url":"https://api.github.com/repos/OpenSlides/OpenSlides/pulls/comments/24722268","id":24722268,"diff_hunk":"@@ -0,0 +1,86 @@\n+import json\n+\n+from openslides.utils.test import TestCase\n+\n+\n+class TestWhoAmIView(TestCase):\n+    url = '/users/whoami/'\n+\n+    def test_get_anonymous(self):\n+        response = self.client.get(self.url)\n+\n+        self.assertEqual(response.status_code, 200)\n+        self.assertEqual(response.content, b'{\"user_id\": null}')\n+\n+    def test_get_logedin(self):\n+        self.client.login(username='admin', password='admin')\n+\n+        response = self.client.get(self.url)\n+\n+        self.assertEqual(response.status_code, 200)\n+        self.assertEqual(response.content, b'{\"user_id\": 1}')\n+\n+    def test_post(self):\n+        response = self.client.post(self.url)\n+\n+        self.assertEqual(response.status_code, 405)\n+\n+\n+class TestUserLogoutView(TestCase):\n+    url = '/users/logout/'\n+\n+    def test_get(self):\n+        response = self.client.get(self.url)\n+\n+        self.assertEqual(response.status_code, 405)\n+\n+    def test_post_anonymous(self):\n+        response = self.client.post(self.url)\n+\n+        self.assertEqual(response.status_code, 200)\n+\n+    def test_post_logedin(self):\n+        self.client.login(username='admin', password='admin')\n+        self.client.session['test_key'] = 'test_value'\n+\n+        response = self.client.post(self.url)\n+\n+        self.assertEqual(response.status_code, 200)\n+        self.assertFalse(hasattr(self.client.session, 'test_key'))\n+\n+\n+class TestUserLoginView(TestCase):\n+    url = '/users/login/'\n+\n+    def test_get(self):\n+        response = self.client.get(self.url)\n+\n+        self.assertEqual(response.status_code, 405)\n+\n+    def test_post_no_data(self):\n+        response = self.client.post(self.url)\n+\n+        self.assertEqual(response.status_code, 200)\n+        self.assertEqual(response.content, b'{\"success\": false}')\n+\n+    def test_post_correct_data(self):\n+        response = self.client.post(","path":"tests/integration/users/test_views.py","position":67,"original_position":67,"commit_id":"b620e21bdb6e245aa886c74943942855dfd5c554","original_commit_id":"d85356631240db7295ce2369475e5a22b8692ff5","user":{"login":"normanjaeckel","id":2073844,"avatar_url":"https://avatars.githubusercontent.com/u/2073844?v=3","gravatar_id":"","url":"https://api.github.com/users/normanjaeckel","html_url":"https://github.com/normanjaeckel","followers_url":"https://api.github.com/users/normanjaeckel/followers","following_url":"https://api.github.com/users/normanjaeckel/following{/other_user}","gists_url":"https://api.github.com/users/normanjaeckel/gists{/gist_id}","starred_url":"https://api.github.com/users/normanjaeckel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/normanjaeckel/subscriptions","organizations_url":"https://api.github.com/users/normanjaeckel/orgs","repos_url":"https://api.github.com/users/normanjaeckel/repos","events_url":"https://api.github.com/users/normanjaeckel/events{/privacy}","received_events_url":"https://api.github.com/users/normanjaeckel/received_events","type":"User","site_admin":false},"body":"See here: https://github.com/OpenSlides/OpenSlides/blob/master/tests/integration/users/test_viewset.py#L47 and especially line 73.","created_at":"2015-02-15T13:14:24Z","updated_at":"2015-02-15T13:14:24Z","html_url":"https://github.com/OpenSlides/OpenSlides/pull/1465#discussion_r24722268","pull_request_url":"https://api.github.com/repos/OpenSlides/OpenSlides/pulls/1465","_links":{"self":{"href":"https://api.github.com/repos/OpenSlides/OpenSlides/pulls/comments/24722268"},"html":{"href":"https://github.com/OpenSlides/OpenSlides/pull/1465#discussion_r24722268"},"pull_request":{"href":"https://api.github.com/repos/OpenSlides/OpenSlides/pulls/1465"}}},"pull_request":{"url":"https://api.github.com/repos/OpenSlides/OpenSlides/pulls/1465","id":29313530,"html_url":"https://github.com/OpenSlides/OpenSlides/pull/1465","diff_url":"https://github.com/OpenSlides/OpenSlides/pull/1465.diff","patch_url":"https://github.com/OpenSlides/OpenSlides/pull/1465.patch","issue_url":"https://api.github.com/repos/OpenSlides/OpenSlides/issues/1465","number":1465,"state":"open","locked":false,"title":"Implemented auth via angular","user":{"login":"ostcar","id":977937,"avatar_url":"https://avatars.githubusercontent.com/u/977937?v=3","gravatar_id":"","url":"https://api.github.com/users/ostcar","html_url":"https://github.com/ostcar","followers_url":"https://api.github.com/users/ostcar/followers","following_url":"https://api.github.com/users/ostcar/following{/other_user}","gists_url":"https://api.github.com/users/ostcar/gists{/gist_id}","starred_url":"https://api.github.com/users/ostcar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ostcar/subscriptions","organizations_url":"https://api.github.com/users/ostcar/orgs","repos_url":"https://api.github.com/users/ostcar/repos","events_url":"https://api.github.com/users/ostcar/events{/privacy}","received_events_url":"https://api.github.com/users/ostcar/received_events","type":"User","site_admin":false},"body":"Also added the derective osPerms to check if the current user has permissions.\r\n\r\nRemoved old django views and urls for user\r\n\r\nfixes: #1454","created_at":"2015-02-14T02:02:38Z","updated_at":"2015-02-15T13:14:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a0190e86df70fce4d8ce840f7828611b6f360230","assignee":{"login":"normanjaeckel","id":2073844,"avatar_url":"https://avatars.githubusercontent.com/u/2073844?v=3","gravatar_id":"","url":"https://api.github.com/users/normanjaeckel","html_url":"https://github.com/normanjaeckel","followers_url":"https://api.github.com/users/normanjaeckel/followers","following_url":"https://api.github.com/users/normanjaeckel/following{/other_user}","gists_url":"https://api.github.com/users/normanjaeckel/gists{/gist_id}","starred_url":"https://api.github.com/users/normanjaeckel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/normanjaeckel/subscriptions","organizations_url":"https://api.github.com/users/normanjaeckel/orgs","repos_url":"https://api.github.com/users/normanjaeckel/repos","events_url":"https://api.github.com/users/normanjaeckel/events{/privacy}","received_events_url":"https://api.github.com/users/normanjaeckel/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/OpenSlides/OpenSlides/milestones/17","labels_url":"https://api.github.com/repos/OpenSlides/OpenSlides/milestones/17/labels","id":720870,"number":17,"title":"2.0","description":"We think we are ready not before May 2015.","creator":{"login":"normanjaeckel","id":2073844,"avatar_url":"https://avatars.githubusercontent.com/u/2073844?v=3","gravatar_id":"","url":"https://api.github.com/users/normanjaeckel","html_url":"https://github.com/normanjaeckel","followers_url":"https://api.github.com/users/normanjaeckel/followers","following_url":"https://api.github.com/users/normanjaeckel/following{/other_user}","gists_url":"https://api.github.com/users/normanjaeckel/gists{/gist_id}","starred_url":"https://api.github.com/users/normanjaeckel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/normanjaeckel/subscriptions","organizations_url":"https://api.github.com/users/normanjaeckel/orgs","repos_url":"https://api.github.com/users/normanjaeckel/repos","events_url":"https://api.github.com/users/normanjaeckel/events{/privacy}","received_events_url":"https://api.github.com/users/normanjaeckel/received_events","type":"User","site_admin":false},"open_issues":50,"closed_issues":63,"state":"open","created_at":"2014-07-14T20:36:14Z","updated_at":"2015-02-15T00:57:03Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/OpenSlides/OpenSlides/pulls/1465/commits","review_comments_url":"https://api.github.com/repos/OpenSlides/OpenSlides/pulls/1465/comments","review_comment_url":"https://api.github.com/repos/OpenSlides/OpenSlides/pulls/comments/{number}","comments_url":"https://api.github.com/repos/OpenSlides/OpenSlides/issues/1465/comments","statuses_url":"https://api.github.com/repos/OpenSlides/OpenSlides/statuses/b620e21bdb6e245aa886c74943942855dfd5c554","head":{"label":"ostcar:auth","ref":"auth","sha":"b620e21bdb6e245aa886c74943942855dfd5c554","user":{"login":"ostcar","id":977937,"avatar_url":"https://avatars.githubusercontent.com/u/977937?v=3","gravatar_id":"","url":"https://api.github.com/users/ostcar","html_url":"https://github.com/ostcar","followers_url":"https://api.github.com/users/ostcar/followers","following_url":"https://api.github.com/users/ostcar/following{/other_user}","gists_url":"https://api.github.com/users/ostcar/gists{/gist_id}","starred_url":"https://api.github.com/users/ostcar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ostcar/subscriptions","organizations_url":"https://api.github.com/users/ostcar/orgs","repos_url":"https://api.github.com/users/ostcar/repos","events_url":"https://api.github.com/users/ostcar/events{/privacy}","received_events_url":"https://api.github.com/users/ostcar/received_events","type":"User","site_admin":false},"repo":{"id":5257807,"name":"OpenSlides","full_name":"ostcar/OpenSlides","owner":{"login":"ostcar","id":977937,"avatar_url":"https://avatars.githubusercontent.com/u/977937?v=3","gravatar_id":"","url":"https://api.github.com/users/ostcar","html_url":"https://github.com/ostcar","followers_url":"https://api.github.com/users/ostcar/followers","following_url":"https://api.github.com/users/ostcar/following{/other_user}","gists_url":"https://api.github.com/users/ostcar/gists{/gist_id}","starred_url":"https://api.github.com/users/ostcar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ostcar/subscriptions","organizations_url":"https://api.github.com/users/ostcar/orgs","repos_url":"https://api.github.com/users/ostcar/repos","events_url":"https://api.github.com/users/ostcar/events{/privacy}","received_events_url":"https://api.github.com/users/ostcar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ostcar/OpenSlides","description":"","fork":true,"url":"https://api.github.com/repos/ostcar/OpenSlides","forks_url":"https://api.github.com/repos/ostcar/OpenSlides/forks","keys_url":"https://api.github.com/repos/ostcar/OpenSlides/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ostcar/OpenSlides/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ostcar/OpenSlides/teams","hooks_url":"https://api.github.com/repos/ostcar/OpenSlides/hooks","issue_events_url":"https://api.github.com/repos/ostcar/OpenSlides/issues/events{/number}","events_url":"https://api.github.com/repos/ostcar/OpenSlides/events","assignees_url":"https://api.github.com/repos/ostcar/OpenSlides/assignees{/user}","branches_url":"https://api.github.com/repos/ostcar/OpenSlides/branches{/branch}","tags_url":"https://api.github.com/repos/ostcar/OpenSlides/tags","blobs_url":"https://api.github.com/repos/ostcar/OpenSlides/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ostcar/OpenSlides/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ostcar/OpenSlides/git/refs{/sha}","trees_url":"https://api.github.com/repos/ostcar/OpenSlides/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ostcar/OpenSlides/statuses/{sha}","languages_url":"https://api.github.com/repos/ostcar/OpenSlides/languages","stargazers_url":"https://api.github.com/repos/ostcar/OpenSlides/stargazers","contributors_url":"https://api.github.com/repos/ostcar/OpenSlides/contributors","subscribers_url":"https://api.github.com/repos/ostcar/OpenSlides/subscribers","subscription_url":"https://api.github.com/repos/ostcar/OpenSlides/subscription","commits_url":"https://api.github.com/repos/ostcar/OpenSlides/commits{/sha}","git_commits_url":"https://api.github.com/repos/ostcar/OpenSlides/git/commits{/sha}","comments_url":"https://api.github.com/repos/ostcar/OpenSlides/comments{/number}","issue_comment_url":"https://api.github.com/repos/ostcar/OpenSlides/issues/comments/{number}","contents_url":"https://api.github.com/repos/ostcar/OpenSlides/contents/{+path}","compare_url":"https://api.github.com/repos/ostcar/OpenSlides/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ostcar/OpenSlides/merges","archive_url":"https://api.github.com/repos/ostcar/OpenSlides/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ostcar/OpenSlides/downloads","issues_url":"https://api.github.com/repos/ostcar/OpenSlides/issues{/number}","pulls_url":"https://api.github.com/repos/ostcar/OpenSlides/pulls{/number}","milestones_url":"https://api.github.com/repos/ostcar/OpenSlides/milestones{/number}","notifications_url":"https://api.github.com/repos/ostcar/OpenSlides/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ostcar/OpenSlides/labels{/name}","releases_url":"https://api.github.com/repos/ostcar/OpenSlides/releases{/id}","created_at":"2012-08-01T10:15:17Z","updated_at":"2015-02-12T09:40:26Z","pushed_at":"2015-02-15T00:59:42Z","git_url":"git://github.com/ostcar/OpenSlides.git","ssh_url":"git@github.com:ostcar/OpenSlides.git","clone_url":"https://github.com/ostcar/OpenSlides.git","svn_url":"https://github.com/ostcar/OpenSlides","homepage":null,"size":37205,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"OpenSlides:master","ref":"master","sha":"a6d0c88730e9292b1a9deba6c606018965141d1d","user":{"login":"OpenSlides","id":2055730,"avatar_url":"https://avatars.githubusercontent.com/u/2055730?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenSlides","html_url":"https://github.com/OpenSlides","followers_url":"https://api.github.com/users/OpenSlides/followers","following_url":"https://api.github.com/users/OpenSlides/following{/other_user}","gists_url":"https://api.github.com/users/OpenSlides/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenSlides/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenSlides/subscriptions","organizations_url":"https://api.github.com/users/OpenSlides/orgs","repos_url":"https://api.github.com/users/OpenSlides/repos","events_url":"https://api.github.com/users/OpenSlides/events{/privacy}","received_events_url":"https://api.github.com/users/OpenSlides/received_events","type":"Organization","site_admin":false},"repo":{"id":5250779,"name":"OpenSlides","full_name":"OpenSlides/OpenSlides","owner":{"login":"OpenSlides","id":2055730,"avatar_url":"https://avatars.githubusercontent.com/u/2055730?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenSlides","html_url":"https://github.com/OpenSlides","followers_url":"https://api.github.com/users/OpenSlides/followers","following_url":"https://api.github.com/users/OpenSlides/following{/other_user}","gists_url":"https://api.github.com/users/OpenSlides/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenSlides/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenSlides/subscriptions","organizations_url":"https://api.github.com/users/OpenSlides/orgs","repos_url":"https://api.github.com/users/OpenSlides/repos","events_url":"https://api.github.com/users/OpenSlides/events{/privacy}","received_events_url":"https://api.github.com/users/OpenSlides/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenSlides/OpenSlides","description":"Presentation and assembly system","fork":false,"url":"https://api.github.com/repos/OpenSlides/OpenSlides","forks_url":"https://api.github.com/repos/OpenSlides/OpenSlides/forks","keys_url":"https://api.github.com/repos/OpenSlides/OpenSlides/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenSlides/OpenSlides/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenSlides/OpenSlides/teams","hooks_url":"https://api.github.com/repos/OpenSlides/OpenSlides/hooks","issue_events_url":"https://api.github.com/repos/OpenSlides/OpenSlides/issues/events{/number}","events_url":"https://api.github.com/repos/OpenSlides/OpenSlides/events","assignees_url":"https://api.github.com/repos/OpenSlides/OpenSlides/assignees{/user}","branches_url":"https://api.github.com/repos/OpenSlides/OpenSlides/branches{/branch}","tags_url":"https://api.github.com/repos/OpenSlides/OpenSlides/tags","blobs_url":"https://api.github.com/repos/OpenSlides/OpenSlides/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenSlides/OpenSlides/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenSlides/OpenSlides/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenSlides/OpenSlides/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenSlides/OpenSlides/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenSlides/OpenSlides/languages","stargazers_url":"https://api.github.com/repos/OpenSlides/OpenSlides/stargazers","contributors_url":"https://api.github.com/repos/OpenSlides/OpenSlides/contributors","subscribers_url":"https://api.github.com/repos/OpenSlides/OpenSlides/subscribers","subscription_url":"https://api.github.com/repos/OpenSlides/OpenSlides/subscription","commits_url":"https://api.github.com/repos/OpenSlides/OpenSlides/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenSlides/OpenSlides/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenSlides/OpenSlides/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenSlides/OpenSlides/issues/comments/{number}","contents_url":"https://api.github.com/repos/OpenSlides/OpenSlides/contents/{+path}","compare_url":"https://api.github.com/repos/OpenSlides/OpenSlides/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenSlides/OpenSlides/merges","archive_url":"https://api.github.com/repos/OpenSlides/OpenSlides/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenSlides/OpenSlides/downloads","issues_url":"https://api.github.com/repos/OpenSlides/OpenSlides/issues{/number}","pulls_url":"https://api.github.com/repos/OpenSlides/OpenSlides/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenSlides/OpenSlides/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenSlides/OpenSlides/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenSlides/OpenSlides/labels{/name}","releases_url":"https://api.github.com/repos/OpenSlides/OpenSlides/releases{/id}","created_at":"2012-07-31T20:04:39Z","updated_at":"2015-02-14T02:26:22Z","pushed_at":"2015-02-14T02:26:22Z","git_url":"git://github.com/OpenSlides/OpenSlides.git","ssh_url":"git@github.com:OpenSlides/OpenSlides.git","clone_url":"https://github.com/OpenSlides/OpenSlides.git","svn_url":"https://github.com/OpenSlides/OpenSlides","homepage":"http://openslides.org","size":38617,"stargazers_count":53,"watchers_count":53,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":27,"mirror_url":null,"open_issues_count":111,"forks":27,"open_issues":111,"watchers":53,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenSlides/OpenSlides/pulls/1465"},"html":{"href":"https://github.com/OpenSlides/OpenSlides/pull/1465"},"issue":{"href":"https://api.github.com/repos/OpenSlides/OpenSlides/issues/1465"},"comments":{"href":"https://api.github.com/repos/OpenSlides/OpenSlides/issues/1465/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenSlides/OpenSlides/pulls/1465/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenSlides/OpenSlides/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/OpenSlides/OpenSlides/pulls/1465/commits"},"statuses":{"href":"https://api.github.com/repos/OpenSlides/OpenSlides/statuses/b620e21bdb6e245aa886c74943942855dfd5c554"}}}}