{"action":"created","comment":{"url":"https://api.github.com/repos/mruwnik/mikroklocki/pulls/comments/44231505","id":44231505,"diff_hunk":"@@ -0,0 +1,20 @@\n+from application.models import Microcontroller, Module\n+\n+\n+def test_microcontroller_repr():","path":"application/models_test.py","position":4,"original_position":4,"commit_id":"ed30c068f9f9b7d777a3f835f40f266c5fcd8517","original_commit_id":"ed30c068f9f9b7d777a3f835f40f266c5fcd8517","user":{"login":"mruwnik","id":3942390,"avatar_url":"https://avatars.githubusercontent.com/u/3942390?v=3","gravatar_id":"","url":"https://api.github.com/users/mruwnik","html_url":"https://github.com/mruwnik","followers_url":"https://api.github.com/users/mruwnik/followers","following_url":"https://api.github.com/users/mruwnik/following{/other_user}","gists_url":"https://api.github.com/users/mruwnik/gists{/gist_id}","starred_url":"https://api.github.com/users/mruwnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mruwnik/subscriptions","organizations_url":"https://api.github.com/users/mruwnik/orgs","repos_url":"https://api.github.com/users/mruwnik/repos","events_url":"https://api.github.com/users/mruwnik/events{/privacy}","received_events_url":"https://api.github.com/users/mruwnik/received_events","type":"User","site_admin":false},"body":"parametrize is good for this kid of thing, e.g.:\r\n```\r\nimport pytest\r\n\r\n@pytest.mark.parametrize('name, expected_name', (\r\n    ('Atmega 1250', 'Name: Atmega 1250'),\r\n    ('bla bla bla', 'Name: bla bla bla'),\r\n    ('Random name', 'Name: Random name'),\r\n    ('bla\\nbla\\nbla\\n', 'Name: bla\\nbla\\nbla\\n'),\r\n    ('', 'Name: '),\r\n    (None, 'Name: None'),\r\n)\r\ndef test_microcontroller_repr(name, expected_name):\r\n    mc = Microcontroller(id=2, name=name)\r\n    assert str(mc) == expected_name\r\n```","created_at":"2015-11-08T22:07:43Z","updated_at":"2015-11-08T22:07:43Z","html_url":"https://github.com/mruwnik/mikroklocki/pull/1#discussion_r44231505","pull_request_url":"https://api.github.com/repos/mruwnik/mikroklocki/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/mruwnik/mikroklocki/pulls/comments/44231505"},"html":{"href":"https://github.com/mruwnik/mikroklocki/pull/1#discussion_r44231505"},"pull_request":{"href":"https://api.github.com/repos/mruwnik/mikroklocki/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/mruwnik/mikroklocki/pulls/1","id":50039596,"html_url":"https://github.com/mruwnik/mikroklocki/pull/1","diff_url":"https://github.com/mruwnik/mikroklocki/pull/1.diff","patch_url":"https://github.com/mruwnik/mikroklocki/pull/1.patch","issue_url":"https://api.github.com/repos/mruwnik/mikroklocki/issues/1","number":1,"state":"open","locked":false,"title":"Semi-finished project","user":{"login":"mjenczmyk","id":11525265,"avatar_url":"https://avatars.githubusercontent.com/u/11525265?v=3","gravatar_id":"","url":"https://api.github.com/users/mjenczmyk","html_url":"https://github.com/mjenczmyk","followers_url":"https://api.github.com/users/mjenczmyk/followers","following_url":"https://api.github.com/users/mjenczmyk/following{/other_user}","gists_url":"https://api.github.com/users/mjenczmyk/gists{/gist_id}","starred_url":"https://api.github.com/users/mjenczmyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjenczmyk/subscriptions","organizations_url":"https://api.github.com/users/mjenczmyk/orgs","repos_url":"https://api.github.com/users/mjenczmyk/repos","events_url":"https://api.github.com/users/mjenczmyk/events{/privacy}","received_events_url":"https://api.github.com/users/mjenczmyk/received_events","type":"User","site_admin":false},"body":"First of all I'm sorry - I haven't read README carefully and I didn't notice that I should make pull requests step by step. I focused on mail sent by Magda and it wasn't written there explicitly.\r\n\r\nThat is semi-finished project. What remains to be done is to write some tests and improve code standards.\r\n\r\nSome remarks/questions:\r\n* I used Python 3.4;\r\n* to run app you have to run load_xml_to_db.py file and than fire up run.py module;\r\n* database used in app is stored in /tmp directory. In real life I would put it somewhere else;\r\n* script loading xml file is outside app package. I'm not sure if it's good solution, but in real life db is loaded once and updated from user interface, so I thought it should be fine. If you think otherwise please inform me;\r\n* I'm not sure if writing to_html method for classes in models.py file is a good idea. It breaks separation of logic and interface, but on the other hand allows using more generic templates;\r\n* After some thinking I'm going to break down functions in views.py in two: one for listing items, second for viewing some particular item. I will make that change in next commits.","created_at":"2015-11-07T16:40:45Z","updated_at":"2015-11-08T22:07:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6f1922138a103b57e62c53c39094874331ace216","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mruwnik/mikroklocki/pulls/1/commits","review_comments_url":"https://api.github.com/repos/mruwnik/mikroklocki/pulls/1/comments","review_comment_url":"https://api.github.com/repos/mruwnik/mikroklocki/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mruwnik/mikroklocki/issues/1/comments","statuses_url":"https://api.github.com/repos/mruwnik/mikroklocki/statuses/ed30c068f9f9b7d777a3f835f40f266c5fcd8517","head":{"label":"mjenczmyk:master","ref":"master","sha":"ed30c068f9f9b7d777a3f835f40f266c5fcd8517","user":{"login":"mjenczmyk","id":11525265,"avatar_url":"https://avatars.githubusercontent.com/u/11525265?v=3","gravatar_id":"","url":"https://api.github.com/users/mjenczmyk","html_url":"https://github.com/mjenczmyk","followers_url":"https://api.github.com/users/mjenczmyk/followers","following_url":"https://api.github.com/users/mjenczmyk/following{/other_user}","gists_url":"https://api.github.com/users/mjenczmyk/gists{/gist_id}","starred_url":"https://api.github.com/users/mjenczmyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjenczmyk/subscriptions","organizations_url":"https://api.github.com/users/mjenczmyk/orgs","repos_url":"https://api.github.com/users/mjenczmyk/repos","events_url":"https://api.github.com/users/mjenczmyk/events{/privacy}","received_events_url":"https://api.github.com/users/mjenczmyk/received_events","type":"User","site_admin":false},"repo":{"id":45700767,"name":"mikroklocki","full_name":"mjenczmyk/mikroklocki","owner":{"login":"mjenczmyk","id":11525265,"avatar_url":"https://avatars.githubusercontent.com/u/11525265?v=3","gravatar_id":"","url":"https://api.github.com/users/mjenczmyk","html_url":"https://github.com/mjenczmyk","followers_url":"https://api.github.com/users/mjenczmyk/followers","following_url":"https://api.github.com/users/mjenczmyk/following{/other_user}","gists_url":"https://api.github.com/users/mjenczmyk/gists{/gist_id}","starred_url":"https://api.github.com/users/mjenczmyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjenczmyk/subscriptions","organizations_url":"https://api.github.com/users/mjenczmyk/orgs","repos_url":"https://api.github.com/users/mjenczmyk/repos","events_url":"https://api.github.com/users/mjenczmyk/events{/privacy}","received_events_url":"https://api.github.com/users/mjenczmyk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mjenczmyk/mikroklocki","description":"","fork":true,"url":"https://api.github.com/repos/mjenczmyk/mikroklocki","forks_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/forks","keys_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/teams","hooks_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/hooks","issue_events_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/issues/events{/number}","events_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/events","assignees_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/assignees{/user}","branches_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/branches{/branch}","tags_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/tags","blobs_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/git/refs{/sha}","trees_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/statuses/{sha}","languages_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/languages","stargazers_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/stargazers","contributors_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/contributors","subscribers_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/subscribers","subscription_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/subscription","commits_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/commits{/sha}","git_commits_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/git/commits{/sha}","comments_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/comments{/number}","issue_comment_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/issues/comments{/number}","contents_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/contents/{+path}","compare_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/merges","archive_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/downloads","issues_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/issues{/number}","pulls_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/pulls{/number}","milestones_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/milestones{/number}","notifications_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/labels{/name}","releases_url":"https://api.github.com/repos/mjenczmyk/mikroklocki/releases{/id}","created_at":"2015-11-06T18:50:45Z","updated_at":"2015-11-07T03:00:58Z","pushed_at":"2015-11-08T20:15:18Z","git_url":"git://github.com/mjenczmyk/mikroklocki.git","ssh_url":"git@github.com:mjenczmyk/mikroklocki.git","clone_url":"https://github.com/mjenczmyk/mikroklocki.git","svn_url":"https://github.com/mjenczmyk/mikroklocki","homepage":null,"size":0,"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":"master"}},"base":{"label":"mruwnik:master","ref":"master","sha":"89d5cf50dd7c7a6ef613d2198c061163d4511ad5","user":{"login":"mruwnik","id":3942390,"avatar_url":"https://avatars.githubusercontent.com/u/3942390?v=3","gravatar_id":"","url":"https://api.github.com/users/mruwnik","html_url":"https://github.com/mruwnik","followers_url":"https://api.github.com/users/mruwnik/followers","following_url":"https://api.github.com/users/mruwnik/following{/other_user}","gists_url":"https://api.github.com/users/mruwnik/gists{/gist_id}","starred_url":"https://api.github.com/users/mruwnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mruwnik/subscriptions","organizations_url":"https://api.github.com/users/mruwnik/orgs","repos_url":"https://api.github.com/users/mruwnik/repos","events_url":"https://api.github.com/users/mruwnik/events{/privacy}","received_events_url":"https://api.github.com/users/mruwnik/received_events","type":"User","site_admin":false},"repo":{"id":45383655,"name":"mikroklocki","full_name":"mruwnik/mikroklocki","owner":{"login":"mruwnik","id":3942390,"avatar_url":"https://avatars.githubusercontent.com/u/3942390?v=3","gravatar_id":"","url":"https://api.github.com/users/mruwnik","html_url":"https://github.com/mruwnik","followers_url":"https://api.github.com/users/mruwnik/followers","following_url":"https://api.github.com/users/mruwnik/following{/other_user}","gists_url":"https://api.github.com/users/mruwnik/gists{/gist_id}","starred_url":"https://api.github.com/users/mruwnik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mruwnik/subscriptions","organizations_url":"https://api.github.com/users/mruwnik/orgs","repos_url":"https://api.github.com/users/mruwnik/repos","events_url":"https://api.github.com/users/mruwnik/events{/privacy}","received_events_url":"https://api.github.com/users/mruwnik/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mruwnik/mikroklocki","description":"","fork":false,"url":"https://api.github.com/repos/mruwnik/mikroklocki","forks_url":"https://api.github.com/repos/mruwnik/mikroklocki/forks","keys_url":"https://api.github.com/repos/mruwnik/mikroklocki/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mruwnik/mikroklocki/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mruwnik/mikroklocki/teams","hooks_url":"https://api.github.com/repos/mruwnik/mikroklocki/hooks","issue_events_url":"https://api.github.com/repos/mruwnik/mikroklocki/issues/events{/number}","events_url":"https://api.github.com/repos/mruwnik/mikroklocki/events","assignees_url":"https://api.github.com/repos/mruwnik/mikroklocki/assignees{/user}","branches_url":"https://api.github.com/repos/mruwnik/mikroklocki/branches{/branch}","tags_url":"https://api.github.com/repos/mruwnik/mikroklocki/tags","blobs_url":"https://api.github.com/repos/mruwnik/mikroklocki/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mruwnik/mikroklocki/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mruwnik/mikroklocki/git/refs{/sha}","trees_url":"https://api.github.com/repos/mruwnik/mikroklocki/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mruwnik/mikroklocki/statuses/{sha}","languages_url":"https://api.github.com/repos/mruwnik/mikroklocki/languages","stargazers_url":"https://api.github.com/repos/mruwnik/mikroklocki/stargazers","contributors_url":"https://api.github.com/repos/mruwnik/mikroklocki/contributors","subscribers_url":"https://api.github.com/repos/mruwnik/mikroklocki/subscribers","subscription_url":"https://api.github.com/repos/mruwnik/mikroklocki/subscription","commits_url":"https://api.github.com/repos/mruwnik/mikroklocki/commits{/sha}","git_commits_url":"https://api.github.com/repos/mruwnik/mikroklocki/git/commits{/sha}","comments_url":"https://api.github.com/repos/mruwnik/mikroklocki/comments{/number}","issue_comment_url":"https://api.github.com/repos/mruwnik/mikroklocki/issues/comments{/number}","contents_url":"https://api.github.com/repos/mruwnik/mikroklocki/contents/{+path}","compare_url":"https://api.github.com/repos/mruwnik/mikroklocki/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mruwnik/mikroklocki/merges","archive_url":"https://api.github.com/repos/mruwnik/mikroklocki/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mruwnik/mikroklocki/downloads","issues_url":"https://api.github.com/repos/mruwnik/mikroklocki/issues{/number}","pulls_url":"https://api.github.com/repos/mruwnik/mikroklocki/pulls{/number}","milestones_url":"https://api.github.com/repos/mruwnik/mikroklocki/milestones{/number}","notifications_url":"https://api.github.com/repos/mruwnik/mikroklocki/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mruwnik/mikroklocki/labels{/name}","releases_url":"https://api.github.com/repos/mruwnik/mikroklocki/releases{/id}","created_at":"2015-11-02T09:09:31Z","updated_at":"2015-11-02T09:09:31Z","pushed_at":"2015-11-08T20:15:18Z","git_url":"git://github.com/mruwnik/mikroklocki.git","ssh_url":"git@github.com:mruwnik/mikroklocki.git","clone_url":"https://github.com/mruwnik/mikroklocki.git","svn_url":"https://github.com/mruwnik/mikroklocki","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mruwnik/mikroklocki/pulls/1"},"html":{"href":"https://github.com/mruwnik/mikroklocki/pull/1"},"issue":{"href":"https://api.github.com/repos/mruwnik/mikroklocki/issues/1"},"comments":{"href":"https://api.github.com/repos/mruwnik/mikroklocki/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/mruwnik/mikroklocki/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/mruwnik/mikroklocki/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mruwnik/mikroklocki/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/mruwnik/mikroklocki/statuses/ed30c068f9f9b7d777a3f835f40f266c5fcd8517"}}}}