{"action":"created","comment":{"url":"https://api.github.com/repos/systers/vms/pulls/comments/201163999","pull_request_review_id":135612570,"id":201163999,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMTE2Mzk5OQ==","diff_hunk":"@@ -1,105 +1,179 @@\n # standard library\n import re\n+from urllib.request import urlretrieve\n+import os\n+\n+import PyPDF2\n+from PyPDF2.utils import PdfReadError\n \n # third party\n from selenium import webdriver\n-from selenium.common.exceptions import NoSuchElementException\n+from selenium.webdriver.support.ui import WebDriverWait\n+from selenium.webdriver.support import expected_conditions as EC\n+from selenium.webdriver.common.by import By\n \n # Django\n from django.contrib.staticfiles.testing import LiveServerTestCase\n \n # local Django\n from pom.pages.authenticationPage import AuthenticationPage\n from pom.pages.volunteerProfilePage import VolunteerProfilePage\n-from volunteer.models import Volunteer\n from shift.utils import create_volunteer_with_details\n \n-# Class contains failing test cases which have been documented\n-# Test class commented out to prevent travis build failure\n-\"\"\"\n+\n class VolunteerProfile(LiveServerTestCase):\n-    '''\n-    '''\n+    \"\"\"\n+    Contains tests for:\n+    - Details of volunteer on profile.\n+    - Edit volunteer profile.\n+    - Upload of invalid resume format.\n+    - Upload of valid resume format.\n+    - Checks for resume corrupt uploaded in profile.\n+    \"\"\"\n \n     @classmethod\n     def setUpClass(cls):\n+        \"\"\"Method to initiate class level objects.\n+\n+        This method initiates Firefox WebDriver, WebDriverWait and\n+        the corresponding POM objects for this Test Class\n+        \"\"\"\n         cls.driver = webdriver.Firefox()\n         cls.driver.implicitly_wait(5)\n         cls.driver.maximize_window()\n         cls.profile_page = VolunteerProfilePage(cls.driver)\n         cls.authentication_page = AuthenticationPage(cls.driver)\n+        cls.wait = WebDriverWait(cls.driver, 20)\n+        cls.download_from_internet()\n         super(VolunteerProfile, cls).setUpClass()\n \n     def setUp(self):\n+        \"\"\"\n+        Method consists of statements to be executed before\n+        start of each test.\n+        \"\"\"\n         vol = [\n-            'Sherlock', \"Sherlock\", \"Holmes\", \"221-B Baker Street\", \"London\",\n-            \"London-State\", \"UK\", \"9999999999\", \"idonthave@gmail.com\"\n+            'Goku', \"Son\", \"Goku\", \"Kame House\", \"East District\",\n+            \"East District\", \"East District\", \"9999999999\", \"idonthave@gmail.com\"\n         ]\n-        self.v1 = create_volunteer_with_details(vol)\n-        self.v1.unlisted_organization = 'Detective'\n-        self.v1.save()\n+        self.volunteer_1 = create_volunteer_with_details(vol)\n+        self.volunteer_1.unlisted_organization = 'Detective'\n+        self.volunteer_1.save()\n         self.login_correctly()\n-        self.profile_page.navigate_to_profile()\n \n     def tearDown(self):\n-        pass\n+        \"\"\"\n+        Method consists of statements to be executed at\n+        end of each test.\n+        \"\"\"\n+        self.authentication_page.logout()\n \n     @classmethod\n     def tearDownClass(cls):\n+        \"\"\"\n+        Class method to quit the Firefox WebDriver session after\n+        execution of all tests in class.\n+        \"\"\"\n         cls.driver.quit()\n+        os.remove(os.getcwd() + '/DummyResume.pdf')\n+        os.remove(os.getcwd() + '/DummyZip.zip')\n         super(VolunteerProfile, cls).tearDownClass()\n \n     def login_correctly(self):\n+        \"\"\"\n+        Utility function to login as volunteer user to perform all tests.\n+        \"\"\"\n         self.authentication_page.server_url = self.live_server_url\n         self.authentication_page.login({\n-            'username': \"Sherlock\",\n+            'username': \"Goku\",\n             'password': \"volunteer\"\n         })\n \n+    def wait_for_profile_load(self, profile_name):\n+        \"\"\"\n+        Utility function to perform explicit wait for volunteer profile page.\n+        \"\"\"\n+        self.wait.until(\n+            EC.presence_of_element_located(\n+                (By.XPATH, \"//h1[contains(text(), '\" + profile_name + \"')]\")\n+            )\n+        )\n+\n+    def wait_for_home_page(self):\n+        \"\"\"\n+        Utility function to perform explicit wait for home page.\n+        \"\"\"\n+        self.wait.until(\n+            EC.presence_of_element_located(\n+                (By.XPATH, \"//h1[contains(text(), 'Volunteer Management System')]\")\n+            )\n+        )\n+\n+    @staticmethod\n+    def download_from_internet():\n+        \"\"\"\n+        Utility functions to download dummy resume uploaded to dropbox.\n+        \"\"\"\n+        urlretrieve('https://dl.dropboxusercontent.com/s/08wpfj4n9f9jdnk/DummyResume.pdf',","path":"vms/volunteer/tests/test_volunteerProfile.py","position":132,"original_position":132,"commit_id":"ba4d36537332a93cf53bf44bad0df46faeb6880a","original_commit_id":"ba4d36537332a93cf53bf44bad0df46faeb6880a","user":{"login":"codacy-bot","id":19940114,"node_id":"MDQ6VXNlcjE5OTQwMTE0","avatar_url":"https://avatars1.githubusercontent.com/u/19940114?v=4","gravatar_id":"","url":"https://api.github.com/users/codacy-bot","html_url":"https://github.com/codacy-bot","followers_url":"https://api.github.com/users/codacy-bot/followers","following_url":"https://api.github.com/users/codacy-bot/following{/other_user}","gists_url":"https://api.github.com/users/codacy-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/codacy-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codacy-bot/subscriptions","organizations_url":"https://api.github.com/users/codacy-bot/orgs","repos_url":"https://api.github.com/users/codacy-bot/repos","events_url":"https://api.github.com/users/codacy-bot/events{/privacy}","received_events_url":"https://api.github.com/users/codacy-bot/received_events","type":"User","site_admin":false},"body":"![Codacy](https://app.codacy.com/assets/images/favicon.png) Issue found: [Audit url open for permitted schemes. Allowing use of file:/ or custom schemes is often unexpected.](https://app.codacy.com/app/Systers/vms/pullRequest?prid=1850355)","created_at":"2018-07-09T22:15:30Z","updated_at":"2018-07-09T22:15:30Z","html_url":"https://github.com/systers/vms/pull/774#discussion_r201163999","pull_request_url":"https://api.github.com/repos/systers/vms/pulls/774","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/systers/vms/pulls/comments/201163999"},"html":{"href":"https://github.com/systers/vms/pull/774#discussion_r201163999"},"pull_request":{"href":"https://api.github.com/repos/systers/vms/pulls/774"}}},"pull_request":{"url":"https://api.github.com/repos/systers/vms/pulls/774","id":198649568,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk4NjQ5NTY4","html_url":"https://github.com/systers/vms/pull/774","diff_url":"https://github.com/systers/vms/pull/774.diff","patch_url":"https://github.com/systers/vms/pull/774.patch","issue_url":"https://api.github.com/repos/systers/vms/issues/774","number":774,"state":"open","locked":false,"title":"Event and job fields add in Volunteer search form","user":{"login":"anjali-dhanuka","id":22369767,"node_id":"MDQ6VXNlcjIyMzY5NzY3","avatar_url":"https://avatars3.githubusercontent.com/u/22369767?v=4","gravatar_id":"","url":"https://api.github.com/users/anjali-dhanuka","html_url":"https://github.com/anjali-dhanuka","followers_url":"https://api.github.com/users/anjali-dhanuka/followers","following_url":"https://api.github.com/users/anjali-dhanuka/following{/other_user}","gists_url":"https://api.github.com/users/anjali-dhanuka/gists{/gist_id}","starred_url":"https://api.github.com/users/anjali-dhanuka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anjali-dhanuka/subscriptions","organizations_url":"https://api.github.com/users/anjali-dhanuka/orgs","repos_url":"https://api.github.com/users/anjali-dhanuka/repos","events_url":"https://api.github.com/users/anjali-dhanuka/events{/privacy}","received_events_url":"https://api.github.com/users/anjali-dhanuka/received_events","type":"User","site_admin":false},"body":"# Description\r\nAdd event and job in search volunteer form\r\n\r\nFixes #773 \r\n\r\n# Type of Change:\r\n- Code\r\n- Quality Assurance\r\n\r\n**Code/Quality Assurance Only**\r\n- New feature (non-breaking change which adds functionality pre-approved by mentors)\r\n\r\n# How Has This Been Tested?\r\n![image](https://user-images.githubusercontent.com/22369767/42161441-9e27aa32-7e18-11e8-816c-1e07978e58eb.png)\r\n\r\n\r\n# Checklist:\r\n- [ ] My PR follows the style guidelines of this project\r\n- [ ] I have performed a self-review of my own code or materials\r\n- [ ] I have commented my code or provided relevant documentation, particularly in hard-to-understand areas\r\n- [ ] I have made corresponding changes to the documentation\r\n- [ ] Any dependent changes have been merged \r\n\r\n**Code/Quality Assurance Only**\r\n- [ ] My changes generate no new warnings \r\n- [ ] I have added tests that prove my fix is effective or that my feature works\r\n- [ ] New and existing unit tests pass locally with my changes\r\n- [ ] Any dependent changes have been published in downstream modules\r\n","created_at":"2018-07-02T11:25:13Z","updated_at":"2018-07-09T22:15:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6b610fd25e964569dcf0d6793778a890bd242b76","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/systers/vms/pulls/774/commits","review_comments_url":"https://api.github.com/repos/systers/vms/pulls/774/comments","review_comment_url":"https://api.github.com/repos/systers/vms/pulls/comments{/number}","comments_url":"https://api.github.com/repos/systers/vms/issues/774/comments","statuses_url":"https://api.github.com/repos/systers/vms/statuses/ba4d36537332a93cf53bf44bad0df46faeb6880a","head":{"label":"anjali-dhanuka:volunteer_search","ref":"volunteer_search","sha":"ba4d36537332a93cf53bf44bad0df46faeb6880a","user":{"login":"anjali-dhanuka","id":22369767,"node_id":"MDQ6VXNlcjIyMzY5NzY3","avatar_url":"https://avatars3.githubusercontent.com/u/22369767?v=4","gravatar_id":"","url":"https://api.github.com/users/anjali-dhanuka","html_url":"https://github.com/anjali-dhanuka","followers_url":"https://api.github.com/users/anjali-dhanuka/followers","following_url":"https://api.github.com/users/anjali-dhanuka/following{/other_user}","gists_url":"https://api.github.com/users/anjali-dhanuka/gists{/gist_id}","starred_url":"https://api.github.com/users/anjali-dhanuka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anjali-dhanuka/subscriptions","organizations_url":"https://api.github.com/users/anjali-dhanuka/orgs","repos_url":"https://api.github.com/users/anjali-dhanuka/repos","events_url":"https://api.github.com/users/anjali-dhanuka/events{/privacy}","received_events_url":"https://api.github.com/users/anjali-dhanuka/received_events","type":"User","site_admin":false},"repo":{"id":113863490,"node_id":"MDEwOlJlcG9zaXRvcnkxMTM4NjM0OTA=","name":"vms","full_name":"anjali-dhanuka/vms","owner":{"login":"anjali-dhanuka","id":22369767,"node_id":"MDQ6VXNlcjIyMzY5NzY3","avatar_url":"https://avatars3.githubusercontent.com/u/22369767?v=4","gravatar_id":"","url":"https://api.github.com/users/anjali-dhanuka","html_url":"https://github.com/anjali-dhanuka","followers_url":"https://api.github.com/users/anjali-dhanuka/followers","following_url":"https://api.github.com/users/anjali-dhanuka/following{/other_user}","gists_url":"https://api.github.com/users/anjali-dhanuka/gists{/gist_id}","starred_url":"https://api.github.com/users/anjali-dhanuka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anjali-dhanuka/subscriptions","organizations_url":"https://api.github.com/users/anjali-dhanuka/orgs","repos_url":"https://api.github.com/users/anjali-dhanuka/repos","events_url":"https://api.github.com/users/anjali-dhanuka/events{/privacy}","received_events_url":"https://api.github.com/users/anjali-dhanuka/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/anjali-dhanuka/vms","description":"Volunteer Management System","fork":true,"url":"https://api.github.com/repos/anjali-dhanuka/vms","forks_url":"https://api.github.com/repos/anjali-dhanuka/vms/forks","keys_url":"https://api.github.com/repos/anjali-dhanuka/vms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/anjali-dhanuka/vms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/anjali-dhanuka/vms/teams","hooks_url":"https://api.github.com/repos/anjali-dhanuka/vms/hooks","issue_events_url":"https://api.github.com/repos/anjali-dhanuka/vms/issues/events{/number}","events_url":"https://api.github.com/repos/anjali-dhanuka/vms/events","assignees_url":"https://api.github.com/repos/anjali-dhanuka/vms/assignees{/user}","branches_url":"https://api.github.com/repos/anjali-dhanuka/vms/branches{/branch}","tags_url":"https://api.github.com/repos/anjali-dhanuka/vms/tags","blobs_url":"https://api.github.com/repos/anjali-dhanuka/vms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/anjali-dhanuka/vms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/anjali-dhanuka/vms/git/refs{/sha}","trees_url":"https://api.github.com/repos/anjali-dhanuka/vms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/anjali-dhanuka/vms/statuses/{sha}","languages_url":"https://api.github.com/repos/anjali-dhanuka/vms/languages","stargazers_url":"https://api.github.com/repos/anjali-dhanuka/vms/stargazers","contributors_url":"https://api.github.com/repos/anjali-dhanuka/vms/contributors","subscribers_url":"https://api.github.com/repos/anjali-dhanuka/vms/subscribers","subscription_url":"https://api.github.com/repos/anjali-dhanuka/vms/subscription","commits_url":"https://api.github.com/repos/anjali-dhanuka/vms/commits{/sha}","git_commits_url":"https://api.github.com/repos/anjali-dhanuka/vms/git/commits{/sha}","comments_url":"https://api.github.com/repos/anjali-dhanuka/vms/comments{/number}","issue_comment_url":"https://api.github.com/repos/anjali-dhanuka/vms/issues/comments{/number}","contents_url":"https://api.github.com/repos/anjali-dhanuka/vms/contents/{+path}","compare_url":"https://api.github.com/repos/anjali-dhanuka/vms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/anjali-dhanuka/vms/merges","archive_url":"https://api.github.com/repos/anjali-dhanuka/vms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/anjali-dhanuka/vms/downloads","issues_url":"https://api.github.com/repos/anjali-dhanuka/vms/issues{/number}","pulls_url":"https://api.github.com/repos/anjali-dhanuka/vms/pulls{/number}","milestones_url":"https://api.github.com/repos/anjali-dhanuka/vms/milestones{/number}","notifications_url":"https://api.github.com/repos/anjali-dhanuka/vms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/anjali-dhanuka/vms/labels{/name}","releases_url":"https://api.github.com/repos/anjali-dhanuka/vms/releases{/id}","deployments_url":"https://api.github.com/repos/anjali-dhanuka/vms/deployments","created_at":"2017-12-11T13:39:21Z","updated_at":"2018-04-07T17:17:20Z","pushed_at":"2018-07-09T22:13:05Z","git_url":"git://github.com/anjali-dhanuka/vms.git","ssh_url":"git@github.com:anjali-dhanuka/vms.git","clone_url":"https://github.com/anjali-dhanuka/vms.git","svn_url":"https://github.com/anjali-dhanuka/vms","homepage":null,"size":3089,"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":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"systers:gsoc18-code","ref":"gsoc18-code","sha":"1705854e2b284a39ea9e2bcef2d264892edac471","user":{"login":"systers","id":6520415,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY1MjA0MTU=","avatar_url":"https://avatars0.githubusercontent.com/u/6520415?v=4","gravatar_id":"","url":"https://api.github.com/users/systers","html_url":"https://github.com/systers","followers_url":"https://api.github.com/users/systers/followers","following_url":"https://api.github.com/users/systers/following{/other_user}","gists_url":"https://api.github.com/users/systers/gists{/gist_id}","starred_url":"https://api.github.com/users/systers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/systers/subscriptions","organizations_url":"https://api.github.com/users/systers/orgs","repos_url":"https://api.github.com/users/systers/repos","events_url":"https://api.github.com/users/systers/events{/privacy}","received_events_url":"https://api.github.com/users/systers/received_events","type":"Organization","site_admin":false},"repo":{"id":19032264,"node_id":"MDEwOlJlcG9zaXRvcnkxOTAzMjI2NA==","name":"vms","full_name":"systers/vms","owner":{"login":"systers","id":6520415,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY1MjA0MTU=","avatar_url":"https://avatars0.githubusercontent.com/u/6520415?v=4","gravatar_id":"","url":"https://api.github.com/users/systers","html_url":"https://github.com/systers","followers_url":"https://api.github.com/users/systers/followers","following_url":"https://api.github.com/users/systers/following{/other_user}","gists_url":"https://api.github.com/users/systers/gists{/gist_id}","starred_url":"https://api.github.com/users/systers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/systers/subscriptions","organizations_url":"https://api.github.com/users/systers/orgs","repos_url":"https://api.github.com/users/systers/repos","events_url":"https://api.github.com/users/systers/events{/privacy}","received_events_url":"https://api.github.com/users/systers/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/systers/vms","description":"Volunteer Management System","fork":false,"url":"https://api.github.com/repos/systers/vms","forks_url":"https://api.github.com/repos/systers/vms/forks","keys_url":"https://api.github.com/repos/systers/vms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/systers/vms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/systers/vms/teams","hooks_url":"https://api.github.com/repos/systers/vms/hooks","issue_events_url":"https://api.github.com/repos/systers/vms/issues/events{/number}","events_url":"https://api.github.com/repos/systers/vms/events","assignees_url":"https://api.github.com/repos/systers/vms/assignees{/user}","branches_url":"https://api.github.com/repos/systers/vms/branches{/branch}","tags_url":"https://api.github.com/repos/systers/vms/tags","blobs_url":"https://api.github.com/repos/systers/vms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/systers/vms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/systers/vms/git/refs{/sha}","trees_url":"https://api.github.com/repos/systers/vms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/systers/vms/statuses/{sha}","languages_url":"https://api.github.com/repos/systers/vms/languages","stargazers_url":"https://api.github.com/repos/systers/vms/stargazers","contributors_url":"https://api.github.com/repos/systers/vms/contributors","subscribers_url":"https://api.github.com/repos/systers/vms/subscribers","subscription_url":"https://api.github.com/repos/systers/vms/subscription","commits_url":"https://api.github.com/repos/systers/vms/commits{/sha}","git_commits_url":"https://api.github.com/repos/systers/vms/git/commits{/sha}","comments_url":"https://api.github.com/repos/systers/vms/comments{/number}","issue_comment_url":"https://api.github.com/repos/systers/vms/issues/comments{/number}","contents_url":"https://api.github.com/repos/systers/vms/contents/{+path}","compare_url":"https://api.github.com/repos/systers/vms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/systers/vms/merges","archive_url":"https://api.github.com/repos/systers/vms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/systers/vms/downloads","issues_url":"https://api.github.com/repos/systers/vms/issues{/number}","pulls_url":"https://api.github.com/repos/systers/vms/pulls{/number}","milestones_url":"https://api.github.com/repos/systers/vms/milestones{/number}","notifications_url":"https://api.github.com/repos/systers/vms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/systers/vms/labels{/name}","releases_url":"https://api.github.com/repos/systers/vms/releases{/id}","deployments_url":"https://api.github.com/repos/systers/vms/deployments","created_at":"2014-04-22T14:13:57Z","updated_at":"2018-07-02T07:06:55Z","pushed_at":"2018-07-09T22:13:07Z","git_url":"git://github.com/systers/vms.git","ssh_url":"git@github.com:systers/vms.git","clone_url":"https://github.com/systers/vms.git","svn_url":"https://github.com/systers/vms","homepage":"http://52.8.110.63/","size":2905,"stargazers_count":55,"watchers_count":55,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":150,"mirror_url":null,"archived":false,"open_issues_count":113,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":150,"open_issues":113,"watchers":55,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/systers/vms/pulls/774"},"html":{"href":"https://github.com/systers/vms/pull/774"},"issue":{"href":"https://api.github.com/repos/systers/vms/issues/774"},"comments":{"href":"https://api.github.com/repos/systers/vms/issues/774/comments"},"review_comments":{"href":"https://api.github.com/repos/systers/vms/pulls/774/comments"},"review_comment":{"href":"https://api.github.com/repos/systers/vms/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/systers/vms/pulls/774/commits"},"statuses":{"href":"https://api.github.com/repos/systers/vms/statuses/ba4d36537332a93cf53bf44bad0df46faeb6880a"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"codacy-bot"}}