{"action":"created","comment":{"url":"https://api.github.com/repos/swcarpentry/amy/pulls/comments/23505142","id":23505142,"diff_hunk":"@@ -0,0 +1,138 @@\n+# this probably needs refactored for py3\n+from datetime import datetime\n+from StringIO import StringIO\n+from json import dumps\n+\n+from django.test import TestCase\n+\n+from ..models import Site, Event, Role, Person\n+from ..util import PERSON_UPLOAD_FIELDS, upload_person_task_csv,\\\n+    verify_upload_person_task\n+\n+from .base import TestBase\n+\n+class UploadPersonTaskCSVTestCase(TestCase):\n+\n+    def compute_from_string(self, csv_str):\n+        ''' wrap up buffering the raw string & parsing '''\n+        csv_buf = StringIO(csv_str)\n+        # compute & return\n+        return upload_person_task_csv(csv_buf)\n+\n+    def test_basic_parsing(self):\n+        ''' See views.PERSON_UPLOAD_FIELDS for field ordering '''\n+        csv = \"\"\"personal,middle,family,email\\njohn,a,doe,johndoe@email.com\\n,jane,a,doe,janedoe@email.com\"\"\"","path":"workshops/test/test_util.py","position":24,"original_position":24,"commit_id":"ec557f87faef7f731238f4b85763365eb1eaf481","original_commit_id":"ec557f87faef7f731238f4b85763365eb1eaf481","user":{"login":"pbanaszkiewicz","id":72821,"avatar_url":"https://avatars.githubusercontent.com/u/72821?v=3","gravatar_id":"","url":"https://api.github.com/users/pbanaszkiewicz","html_url":"https://github.com/pbanaszkiewicz","followers_url":"https://api.github.com/users/pbanaszkiewicz/followers","following_url":"https://api.github.com/users/pbanaszkiewicz/following{/other_user}","gists_url":"https://api.github.com/users/pbanaszkiewicz/gists{/gist_id}","starred_url":"https://api.github.com/users/pbanaszkiewicz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pbanaszkiewicz/subscriptions","organizations_url":"https://api.github.com/users/pbanaszkiewicz/orgs","repos_url":"https://api.github.com/users/pbanaszkiewicz/repos","events_url":"https://api.github.com/users/pbanaszkiewicz/events{/privacy}","received_events_url":"https://api.github.com/users/pbanaszkiewicz/received_events","type":"User","site_admin":false},"body":"(Personal preference) I'd rather have this split into multiple lines and not use `\"\\n\"` explicitely. You have `\"\"\"` already.","created_at":"2015-01-25T16:15:41Z","updated_at":"2015-01-25T16:15:41Z","html_url":"https://github.com/swcarpentry/amy/pull/165#discussion_r23505142","pull_request_url":"https://api.github.com/repos/swcarpentry/amy/pulls/165","_links":{"self":{"href":"https://api.github.com/repos/swcarpentry/amy/pulls/comments/23505142"},"html":{"href":"https://github.com/swcarpentry/amy/pull/165#discussion_r23505142"},"pull_request":{"href":"https://api.github.com/repos/swcarpentry/amy/pulls/165"}}},"pull_request":{"url":"https://api.github.com/repos/swcarpentry/amy/pulls/165","id":27991894,"html_url":"https://github.com/swcarpentry/amy/pull/165","diff_url":"https://github.com/swcarpentry/amy/pull/165.diff","patch_url":"https://github.com/swcarpentry/amy/pull/165.patch","issue_url":"https://api.github.com/repos/swcarpentry/amy/issues/165","number":165,"state":"open","locked":false,"title":"Add various tweaks and improvements to CSV parsing","user":{"login":"sburns","id":440820,"avatar_url":"https://avatars.githubusercontent.com/u/440820?v=3","gravatar_id":"","url":"https://api.github.com/users/sburns","html_url":"https://github.com/sburns","followers_url":"https://api.github.com/users/sburns/followers","following_url":"https://api.github.com/users/sburns/following{/other_user}","gists_url":"https://api.github.com/users/sburns/gists{/gist_id}","starred_url":"https://api.github.com/users/sburns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sburns/subscriptions","organizations_url":"https://api.github.com/users/sburns/orgs","repos_url":"https://api.github.com/users/sburns/repos","events_url":"https://api.github.com/users/sburns/events{/privacy}","received_events_url":"https://api.github.com/users/sburns/received_events","type":"User","site_admin":false},"body":"* Redirect when no session data after bulk upload\n* case-insensitive email look up\n* Move csv parsing to util.py, add test\n* Move verification to util.py, add tests\n* Ensure data structure from csv parsing is json-serializable","created_at":"2015-01-25T13:17:02Z","updated_at":"2015-01-25T16:15:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1720485d5520729266c268712f30f267293eb04c","assignee":{"login":"pbanaszkiewicz","id":72821,"avatar_url":"https://avatars.githubusercontent.com/u/72821?v=3","gravatar_id":"","url":"https://api.github.com/users/pbanaszkiewicz","html_url":"https://github.com/pbanaszkiewicz","followers_url":"https://api.github.com/users/pbanaszkiewicz/followers","following_url":"https://api.github.com/users/pbanaszkiewicz/following{/other_user}","gists_url":"https://api.github.com/users/pbanaszkiewicz/gists{/gist_id}","starred_url":"https://api.github.com/users/pbanaszkiewicz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pbanaszkiewicz/subscriptions","organizations_url":"https://api.github.com/users/pbanaszkiewicz/orgs","repos_url":"https://api.github.com/users/pbanaszkiewicz/repos","events_url":"https://api.github.com/users/pbanaszkiewicz/events{/privacy}","received_events_url":"https://api.github.com/users/pbanaszkiewicz/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/swcarpentry/amy/pulls/165/commits","review_comments_url":"https://api.github.com/repos/swcarpentry/amy/pulls/165/comments","review_comment_url":"https://api.github.com/repos/swcarpentry/amy/pulls/comments/{number}","comments_url":"https://api.github.com/repos/swcarpentry/amy/issues/165/comments","statuses_url":"https://api.github.com/repos/swcarpentry/amy/statuses/ec557f87faef7f731238f4b85763365eb1eaf481","head":{"label":"sburns:bulk-upload-enhancement","ref":"bulk-upload-enhancement","sha":"ec557f87faef7f731238f4b85763365eb1eaf481","user":{"login":"sburns","id":440820,"avatar_url":"https://avatars.githubusercontent.com/u/440820?v=3","gravatar_id":"","url":"https://api.github.com/users/sburns","html_url":"https://github.com/sburns","followers_url":"https://api.github.com/users/sburns/followers","following_url":"https://api.github.com/users/sburns/following{/other_user}","gists_url":"https://api.github.com/users/sburns/gists{/gist_id}","starred_url":"https://api.github.com/users/sburns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sburns/subscriptions","organizations_url":"https://api.github.com/users/sburns/orgs","repos_url":"https://api.github.com/users/sburns/repos","events_url":"https://api.github.com/users/sburns/events{/privacy}","received_events_url":"https://api.github.com/users/sburns/received_events","type":"User","site_admin":false},"repo":{"id":27539122,"name":"amy","full_name":"sburns/amy","owner":{"login":"sburns","id":440820,"avatar_url":"https://avatars.githubusercontent.com/u/440820?v=3","gravatar_id":"","url":"https://api.github.com/users/sburns","html_url":"https://github.com/sburns","followers_url":"https://api.github.com/users/sburns/followers","following_url":"https://api.github.com/users/sburns/following{/other_user}","gists_url":"https://api.github.com/users/sburns/gists{/gist_id}","starred_url":"https://api.github.com/users/sburns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sburns/subscriptions","organizations_url":"https://api.github.com/users/sburns/orgs","repos_url":"https://api.github.com/users/sburns/repos","events_url":"https://api.github.com/users/sburns/events{/privacy}","received_events_url":"https://api.github.com/users/sburns/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sburns/amy","description":"A web-based workshop administration application built using Django.","fork":true,"url":"https://api.github.com/repos/sburns/amy","forks_url":"https://api.github.com/repos/sburns/amy/forks","keys_url":"https://api.github.com/repos/sburns/amy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sburns/amy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sburns/amy/teams","hooks_url":"https://api.github.com/repos/sburns/amy/hooks","issue_events_url":"https://api.github.com/repos/sburns/amy/issues/events{/number}","events_url":"https://api.github.com/repos/sburns/amy/events","assignees_url":"https://api.github.com/repos/sburns/amy/assignees{/user}","branches_url":"https://api.github.com/repos/sburns/amy/branches{/branch}","tags_url":"https://api.github.com/repos/sburns/amy/tags","blobs_url":"https://api.github.com/repos/sburns/amy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sburns/amy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sburns/amy/git/refs{/sha}","trees_url":"https://api.github.com/repos/sburns/amy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sburns/amy/statuses/{sha}","languages_url":"https://api.github.com/repos/sburns/amy/languages","stargazers_url":"https://api.github.com/repos/sburns/amy/stargazers","contributors_url":"https://api.github.com/repos/sburns/amy/contributors","subscribers_url":"https://api.github.com/repos/sburns/amy/subscribers","subscription_url":"https://api.github.com/repos/sburns/amy/subscription","commits_url":"https://api.github.com/repos/sburns/amy/commits{/sha}","git_commits_url":"https://api.github.com/repos/sburns/amy/git/commits{/sha}","comments_url":"https://api.github.com/repos/sburns/amy/comments{/number}","issue_comment_url":"https://api.github.com/repos/sburns/amy/issues/comments/{number}","contents_url":"https://api.github.com/repos/sburns/amy/contents/{+path}","compare_url":"https://api.github.com/repos/sburns/amy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sburns/amy/merges","archive_url":"https://api.github.com/repos/sburns/amy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sburns/amy/downloads","issues_url":"https://api.github.com/repos/sburns/amy/issues{/number}","pulls_url":"https://api.github.com/repos/sburns/amy/pulls{/number}","milestones_url":"https://api.github.com/repos/sburns/amy/milestones{/number}","notifications_url":"https://api.github.com/repos/sburns/amy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sburns/amy/labels{/name}","releases_url":"https://api.github.com/repos/sburns/amy/releases{/id}","created_at":"2014-12-04T12:18:40Z","updated_at":"2015-01-20T20:59:55Z","pushed_at":"2015-01-25T13:15:27Z","git_url":"git://github.com/sburns/amy.git","ssh_url":"git@github.com:sburns/amy.git","clone_url":"https://github.com/sburns/amy.git","svn_url":"https://github.com/sburns/amy","homepage":null,"size":1881,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"swcarpentry:master","ref":"master","sha":"b19415e08eb5bba7db1044be014cbb126c075d2d","user":{"login":"swcarpentry","id":2238358,"avatar_url":"https://avatars.githubusercontent.com/u/2238358?v=3","gravatar_id":"","url":"https://api.github.com/users/swcarpentry","html_url":"https://github.com/swcarpentry","followers_url":"https://api.github.com/users/swcarpentry/followers","following_url":"https://api.github.com/users/swcarpentry/following{/other_user}","gists_url":"https://api.github.com/users/swcarpentry/gists{/gist_id}","starred_url":"https://api.github.com/users/swcarpentry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swcarpentry/subscriptions","organizations_url":"https://api.github.com/users/swcarpentry/orgs","repos_url":"https://api.github.com/users/swcarpentry/repos","events_url":"https://api.github.com/users/swcarpentry/events{/privacy}","received_events_url":"https://api.github.com/users/swcarpentry/received_events","type":"Organization","site_admin":false},"repo":{"id":27387287,"name":"amy","full_name":"swcarpentry/amy","owner":{"login":"swcarpentry","id":2238358,"avatar_url":"https://avatars.githubusercontent.com/u/2238358?v=3","gravatar_id":"","url":"https://api.github.com/users/swcarpentry","html_url":"https://github.com/swcarpentry","followers_url":"https://api.github.com/users/swcarpentry/followers","following_url":"https://api.github.com/users/swcarpentry/following{/other_user}","gists_url":"https://api.github.com/users/swcarpentry/gists{/gist_id}","starred_url":"https://api.github.com/users/swcarpentry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swcarpentry/subscriptions","organizations_url":"https://api.github.com/users/swcarpentry/orgs","repos_url":"https://api.github.com/users/swcarpentry/repos","events_url":"https://api.github.com/users/swcarpentry/events{/privacy}","received_events_url":"https://api.github.com/users/swcarpentry/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/swcarpentry/amy","description":"A web-based workshop administration application built using Django.","fork":false,"url":"https://api.github.com/repos/swcarpentry/amy","forks_url":"https://api.github.com/repos/swcarpentry/amy/forks","keys_url":"https://api.github.com/repos/swcarpentry/amy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/swcarpentry/amy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/swcarpentry/amy/teams","hooks_url":"https://api.github.com/repos/swcarpentry/amy/hooks","issue_events_url":"https://api.github.com/repos/swcarpentry/amy/issues/events{/number}","events_url":"https://api.github.com/repos/swcarpentry/amy/events","assignees_url":"https://api.github.com/repos/swcarpentry/amy/assignees{/user}","branches_url":"https://api.github.com/repos/swcarpentry/amy/branches{/branch}","tags_url":"https://api.github.com/repos/swcarpentry/amy/tags","blobs_url":"https://api.github.com/repos/swcarpentry/amy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/swcarpentry/amy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/swcarpentry/amy/git/refs{/sha}","trees_url":"https://api.github.com/repos/swcarpentry/amy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/swcarpentry/amy/statuses/{sha}","languages_url":"https://api.github.com/repos/swcarpentry/amy/languages","stargazers_url":"https://api.github.com/repos/swcarpentry/amy/stargazers","contributors_url":"https://api.github.com/repos/swcarpentry/amy/contributors","subscribers_url":"https://api.github.com/repos/swcarpentry/amy/subscribers","subscription_url":"https://api.github.com/repos/swcarpentry/amy/subscription","commits_url":"https://api.github.com/repos/swcarpentry/amy/commits{/sha}","git_commits_url":"https://api.github.com/repos/swcarpentry/amy/git/commits{/sha}","comments_url":"https://api.github.com/repos/swcarpentry/amy/comments{/number}","issue_comment_url":"https://api.github.com/repos/swcarpentry/amy/issues/comments/{number}","contents_url":"https://api.github.com/repos/swcarpentry/amy/contents/{+path}","compare_url":"https://api.github.com/repos/swcarpentry/amy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/swcarpentry/amy/merges","archive_url":"https://api.github.com/repos/swcarpentry/amy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/swcarpentry/amy/downloads","issues_url":"https://api.github.com/repos/swcarpentry/amy/issues{/number}","pulls_url":"https://api.github.com/repos/swcarpentry/amy/pulls{/number}","milestones_url":"https://api.github.com/repos/swcarpentry/amy/milestones{/number}","notifications_url":"https://api.github.com/repos/swcarpentry/amy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/swcarpentry/amy/labels{/name}","releases_url":"https://api.github.com/repos/swcarpentry/amy/releases{/id}","created_at":"2014-12-01T16:07:14Z","updated_at":"2015-01-23T21:28:33Z","pushed_at":"2015-01-23T16:26:20Z","git_url":"git://github.com/swcarpentry/amy.git","ssh_url":"git@github.com:swcarpentry/amy.git","clone_url":"https://github.com/swcarpentry/amy.git","svn_url":"https://github.com/swcarpentry/amy","homepage":null,"size":6217,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":38,"forks":21,"open_issues":38,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/swcarpentry/amy/pulls/165"},"html":{"href":"https://github.com/swcarpentry/amy/pull/165"},"issue":{"href":"https://api.github.com/repos/swcarpentry/amy/issues/165"},"comments":{"href":"https://api.github.com/repos/swcarpentry/amy/issues/165/comments"},"review_comments":{"href":"https://api.github.com/repos/swcarpentry/amy/pulls/165/comments"},"review_comment":{"href":"https://api.github.com/repos/swcarpentry/amy/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/swcarpentry/amy/pulls/165/commits"},"statuses":{"href":"https://api.github.com/repos/swcarpentry/amy/statuses/ec557f87faef7f731238f4b85763365eb1eaf481"}}}}